-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: basic regression tests for the sexp parser
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/- | ||
Copyright (c) 2024 Lean FRO, LLC. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Henrik Böving | ||
-/ | ||
import Leanwuzla | ||
import Leanwuzla.Sexp | ||
|
||
open Std.Tactic.BVDecide | ||
|
||
def expr1 : BVLogicalExpr := .const true | ||
|
||
/-- info: true -/ | ||
#guard_msgs in | ||
#eval Sexp.Parser.manySexps! |>.run (Lean.Elab.Tactic.BVDecide.Frontend.toSMT expr1 {}) |>.isOk | ||
|
||
def expr2 : BVLogicalExpr := .not (.const true) | ||
|
||
/-- info: true -/ | ||
#guard_msgs in | ||
#eval Sexp.Parser.manySexps! |>.run (Lean.Elab.Tactic.BVDecide.Frontend.toSMT expr2 {}) |>.isOk | ||
|
||
def expr3 : BVLogicalExpr := .gate .and (.const true) (.const false) | ||
|
||
/-- info: true -/ | ||
#guard_msgs in | ||
#eval Sexp.Parser.manySexps! |>.run (Lean.Elab.Tactic.BVDecide.Frontend.toSMT expr3 {}) |>.isOk | ||
|
||
def expr4 : BVLogicalExpr := .literal (.bin (.const 10#32) .eq (.const 11#32)) | ||
|
||
/-- info: true -/ | ||
#guard_msgs in | ||
#eval Sexp.Parser.manySexps! |>.run (Lean.Elab.Tactic.BVDecide.Frontend.toSMT expr4 {}) |>.isOk |