Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Strata/DL/SMT/Translate.lean
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def translateTerm (t : SMT.Term) : TranslateM (Expr × Expr) := do
let (as, a) := ((a :: as).dropLast, (a :: as).getLast?.get rfl)
return (mkProp, as.foldr mkArrow a)
| .prim (.int x) =>
return (mkProp, toExpr x)
return (mkInt, toExpr x)
Comment thread
tautschnig marked this conversation as resolved.
| .app .neg [a] _ =>
let (_, a) ← translateTerm a
return (mkInt, .app mkIntNeg a)
Expand Down
7 changes: 7 additions & 0 deletions StrataTest/DL/SMT/TranslateTests.lean
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@ info: ∀ (α : Type → Type → Type) [inst : ∀ (α_1 α_2 : Type), Nonempty
#guard_msgs in
#eval
elabQuery {} [] (.app .eq [(.app .abs [(.prim (.int (-5)))] (.prim .int)), (.prim (.int 5))] (.prim .bool))

/-- info: (if 0 = 0 then 0 else 1) = 0 -/
#guard_msgs in
#eval
let c := .app .eq [(.prim (.int 0)), (.prim (.int 0))] (.prim .bool)
let t := .app .ite [c, (.prim (.int 0)), (.prim (.int 1))] (.prim .int)
Comment thread
tautschnig marked this conversation as resolved.
elabQuery {} [] (.app .eq [t, (.prim (.int 0))] (.prim .bool))
Loading