Skip to content

Commit

Permalink
changed the translation of large integer literals to use Coq's Z type
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddy Westbrook committed Dec 1, 2021
1 parent 2bdc607 commit 966ab60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion saw-core-coq/src/Language/Coq/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ ppTerm p e =
parensIf (p > PrecLambda)
(ppTerm PrecApp tm <+> text ":" <+> ppTerm PrecApp tp)
NatLit i ->
integer i
if i > 20 then
-- Explicitly convert from Z if an integer is too big
parensIf (p > PrecLambda) (text "Z.to_nat" <+> integer i <> text "%Z")
else
integer i
ZLit i ->
-- we use hex unless our integer is a positive or negitive digit
if abs i > 9 then let ui = toInteger (fromInteger i :: Word64)
Expand Down

0 comments on commit 966ab60

Please sign in to comment.