-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInTest.metta
32 lines (28 loc) · 1.09 KB
/
InTest.metta
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
32
;; Test ∉
;; Import modules
!(import! &self In.metta)
!(import! &self Num.metta)
!(import! &self ../synthesis/Synthesize.metta)
;; Define knowledge and rule bases to reason about ∉. This requires
;; reasoning about order as well (Natural for now).
(= (kb) (superpose ((zero-lt-succ-axiom)
(notin-empty-axiom))))
(= (rb) (superpose ((succ-monotonicity-rule)
(lt-notin-recursive-left-rule)
(lt-notin-recursive-right-rule))))
;; Test reasoning about ∉
!(assertEqual ; 2 ∉ ∅
(synthesize (: $proof (∉ Z ∅)) kb rb Z)
(: NotInEmpty (∉ Z ∅)))
;; TODO: re-enabled once unify* can be used
;; !(assertEqual ; 0 ∉ {1}
;; (synthesize (: $proof (∉ Z (insert (S Z) ∅))) (S Z) kb rb)
;; (: (LTNotInRecursiveLeft NotInEmpty NotInEmpty ZeroLTSucc) (∉ Z (insert (S Z) ∅))))
;; NEXT: fix
;; !(synthesize (: $proof (∉ Z (insert (S Z) ∅))) (S Z) kb rb)
!(synthesize
(: (LTNotInRecursiveLeft NotInEmpty NotInEmpty ZeroLTSucc)
(∉ Z (insert (S Z) ∅)))
kb
rb
(S Z))