-
Notifications
You must be signed in to change notification settings - Fork 1
/
discr_2.metta
88 lines (82 loc) · 1.91 KB
/
discr_2.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
; (convert-to-metta-file discr_2 $_274570 discr/discr_2.pl discr/discr_2.metta)
(= ex2
(exc2
(derivation
(<-
(term (:: t1 t2))
(&
(const t1)
(const t2))) app)
(derivation
(<-
(term (:: t1 t2))
(&
(termv t1)
(termc t2))) rej)
(generate-discriminants
(term (:: t1 t2)) $_ $_)))
(= exc2
( (abolish :: 2)
(add-atom &self
(:: c1
(<-
(term $X)
(&
(:=
(:: $X1 $X2) $X)
(&
(term $X1)
(term $X2))))))
(add-atom &self
(:: c2
(<-
(term $X)
(termc $X))))
(add-atom &self
(:: c3
(<-
(term $X)
(termv $X))))
(add-atom &self
(:: c4
(<-
(termc $X)
(&
(:=
(:: $X1 $X2) $X)
(&
(termc $X1)
(termc $X2))))))
(add-atom &self
(:: c5
(<-
(termc $X)
(const $X))))
(add-atom &self
(:: c6
(<-
(termv $X)
(&
(:=
(:: $X1 $X2) $X)
(termv $X1)))))
(add-atom &self
(:: c7
(<-
(termv $X)
(&
(:=
(:: $X1 $X2) $X)
(termv $X2)))))
(add-atom &self
(:: c8
(<-
(termv $X)
(var $X))))
(add-atom &self
(:-
(:: c9
(<-
(:= $X1 $X2) true))
(:= $X1 $X2)))))
(= (?- ex2) True)