-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathnot-symbolo-not-numbero-tests.rkt
167 lines (139 loc) · 4.59 KB
/
not-symbolo-not-numbero-tests.rkt
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
(display "\nRunning not-symbolo/not-numbero tests")
(newline)
(test 'not-symbolo-not-numbero-0
(run* (x y) (not-symbolo x) (not-numbero y))
'(#s(Ans (_.0 _.1) ((not-num _.1) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-1
(run* (x) (not-symbolo x) (not-numbero x))
'(#s(Ans (_.0) ((not-num _.0) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-2a
(run* (x y) (not-symbolo x) (not-numbero y) (== x y))
'(#s(Ans (_.0 _.0) ((not-num _.0) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-2b
(run* (x y) (not-symbolo x) (== x y) (not-numbero y))
'(#s(Ans (_.0 _.0) ((not-num _.0) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-2c
(run* (x y) (== x y) (not-symbolo x) (not-numbero y))
'(#s(Ans (_.0 _.0) ((not-num _.0) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-3
(run* (x y) (== x y) (not-symbolo x) (not-numbero y))
'(#s(Ans (_.0 _.0) ((not-num _.0) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-4a
(run* (x) (fresh (p) (not-numbero p) (== p 'p)))
'((_.0)))
(test 'not-symbolo-not-numbero-4a
(run* (x) (fresh (p) (not-symbolo p) (== p 'p)))
'())
(test 'not-symbolo-not-numbero-5a
(run* (x) (not-numbero x) (conde ((== x 3)) ((== x 'x))))
'((x)))
(test 'not-symbolo-not-numbero-5b
(run* (x) (not-numbero x) (conde ((numbero x)) ((== x 'x))))
'((x)))
(test 'not-symbolo-not-numbero-5c
(run* (x) (not-numbero x) (conde ((numbero x)) ((not-symbolo x))))
'(#s(Ans (_.0) ((not-num _.0) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-5d
(run* (x) (not-numbero x) (conde ((not-symbolo x)) ((numbero x))))
'(#s(Ans (_.0) ((not-num _.0) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-6a
(run* (x) (fresh (p) (not-symbolo x) (not-numbero p) (== p x)))
'(#s(Ans (_.0) ((not-num _.0) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-6b
(run* (x) (fresh (p) (not-symbolo x) (== p x) (not-numbero p)))
'(#s(Ans (_.0) ((not-num _.0) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-6c
(run* (x) (fresh (p) (== p x) (not-symbolo x) (not-numbero p)))
'(#s(Ans (_.0) ((not-num _.0) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-7a
(run* (x) (fresh (p q)
(not-symbolo p)
(not-numbero q)
(== `(,p ,q) x)))
'(#s(Ans ((_.0 _.1)) ((not-num _.1) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-7b
(run* (x) (fresh (p q)
(not-symbolo p)
(== `(,p ,q) x)
(not-numbero q)))
'(#s(Ans ((_.0 _.1)) ((not-num _.1) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-7c
(run* (x) (fresh (p q)
(== `(,p ,q) x)
(not-symbolo p)
(not-numbero q)))
'(#s(Ans ((_.0 _.1)) ((not-num _.1) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-7d
(run* (x) (fresh (p q)
(not-symbolo p)
(not-numbero q)
(== `(,p ,q) x))
(fresh (r s)
(== `(,r ,s) x)))
'(#s(Ans ((_.0 _.1)) ((not-num _.1) (not-sym _.0)))))
(test 'not-symbolo-not-numbero-7d
(run* (x) (fresh (p q)
(not-symbolo p)
(not-numbero q)
(== `(,p ,q) x))
(fresh (r s)
(== `(,r ,s) x)
(== r 5)))
'(#s(Ans ((5 _.0)) ((not-num _.0)))))
(test 'not-symbolo-not-numbero-7e
(run* (x) (fresh (p q)
(not-symbolo p)
(not-numbero q)
(== `(,p ,q) x))
(fresh (r s)
(== `(,r ,s) x)
(== s 's)))
'(#s(Ans ((_.0 s)) ((not-sym _.0)))))
(test 'not-symbolo-not-numbero-8a
(run* (x)
(fresh (p q)
(== `(,p ,q) x)
(=/= `(5 a) x)))
'(#s(Ans ((_.0 _.1)) ((=/= ((_.0 5) (_.1 a)))))))
(test 'not-symbolo-not-numbero-8b
(run* (x)
(fresh (p q)
(== `(,p ,q) x)
(=/= `(5 a) x)
(not-numbero p)))
'(#s(Ans ((_.0 _.1)) ((not-num _.0)))))
(test 'not-symbolo-not-numbero-8c
(run* (x)
(fresh (p q)
(== `(,p ,q) x)
(not-numbero p)
(=/= `(5 a) x)))
'(#s(Ans ((_.0 _.1)) ((not-num _.0)))))
(test 'not-symbolo-not-numbero-8d
(run* (x)
(fresh (p q)
(not-numbero p)
(== `(,p ,q) x)
(=/= `(5 a) x)))
'(#s(Ans ((_.0 _.1)) ((not-num _.0)))))
(test 'not-symbolo-not-numbero-8e
(run* (x)
(fresh (p q)
(== `(,p ,q) x)
(=/= `(5 a) x)
(not-symbolo q)))
'(#s(Ans ((_.0 _.1)) ((not-sym _.1)))))
(test 'not-symbolo-not-numbero-8f
(run* (x)
(fresh (p q)
(== `(,p ,q) x)
(not-symbolo q)
(=/= `(5 a) x)))
'(#s(Ans ((_.0 _.1)) ((not-sym _.1)))))
(test 'not-symbolo-not-numbero-8g
(run* (x)
(fresh (p q)
(not-symbolo q)
(== `(,p ,q) x)
(=/= `(5 a) x)))
'(#s(Ans ((_.0 _.1)) ((not-sym _.1)))))