forked from thanhnguyen-aws/plausible
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathNonLinearPatternsTest.lean
More file actions
31 lines (28 loc) · 1.01 KB
/
Copy pathNonLinearPatternsTest.lean
File metadata and controls
31 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import Plausible.Chamelean.DecOpt
import Plausible.Chamelean.DeriveChecker
import Test.DeriveDecOpt.DeriveBSTChecker
import Test.DeriveArbitrarySuchThat.NonLinearPatternsTest
open DecOpt
set_option guard_msgs.diff true
/--
info: Try this checker: instance : DecOpt (GoodTree in1_1 in2_1 t_1) where
decOpt :=
let rec aux_dec (initSize : Nat) (size : Nat) (in1_1 : Nat) (in2_1 : Nat) (t_1 : BinaryTree) : Option Bool :=
match size with
| Nat.zero =>
DecOpt.checkerBacktrack
[fun _ =>
match t_1 with
| BinaryTree.Leaf => DecOpt.decOpt (BEq.beq in1_1 in2_1) initSize
| _ => Option.some Bool.false]
| Nat.succ size' =>
DecOpt.checkerBacktrack
[fun _ =>
match t_1 with
| BinaryTree.Leaf => DecOpt.decOpt (BEq.beq in1_1 in2_1) initSize
| _ => Option.some Bool.false,
]
fun size => aux_dec size size in1_1 in2_1 t_1
-/
#guard_msgs(info, drop warning) in
#derive_checker (GoodTree in1 in2 t)