-
Notifications
You must be signed in to change notification settings - Fork 6
/
not-pairo-tests.ss
118 lines (96 loc) · 2.13 KB
/
not-pairo-tests.ss
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
(load "mk.scm")
(test-check "not-pairo 0"
(run 1 (q) (not-pairo q) (symbolo q))
'((_.0 (sym _.0))))
(test-check "not-pairo 1"
(run 1 (q) (symbolo q) (not-pairo q))
'((_.0 (sym _.0))))
(test-check "not-pairo 2"
(run 1 (q) (not-pairo q))
'((_.0 (not-pair _.0))))
(test-check "not-pairo 3"
(run 1 (q)
(fresh (x y)
(== x `(1 2))
(not-pairo y)
(=/= x y)))
'(_.0))
(test-check "not-pairo 4"
(run 1 (q)
(fresh (x y)
(== x `(1 2))
(=/= x y)
(not-pairo y)))
'(_.0))
(test-check "not-pairo 5"
(run 1 (q)
(fresh (x y)
(=/= x y)
(not-pairo y)
(== x `(1 2))))
'(_.0))
(test-check "not-pairo 6"
(run 1 (q)
(fresh (x y)
(absento x y)
(not-pairo y)
(== x `(1 2))))
'(_.0))
(test-check "not-pairo 7"
(run 1 (q)
(fresh (x y)
(absento x y)
(== x `(1 2))
(not-pairo y)))
'(_.0))
(test-check "not-pairo 8"
(run 1 (q)
(fresh (x y)
(== x `(1 2))
(absento x y)
(not-pairo y)))
'(_.0))
(test-check "not-pairo 9"
(run 1 (q)
(fresh (x y)
(== x `(1 2))
(not-pairo y)
(absento x y)))
'(_.0))
(test-check "not-pairo 10"
(run 1 (q)
(fresh (x y)
(== x `(1 2))
(not-pairo y)
(absento y x)
(== `(,x ,y) q)))
'((((1 2) _.0)
(=/= ((_.0 ())) ((_.0 1)) ((_.0 2)))
(not-pair _.0))))
(test-check "not-pairo 11"
(run 1 (q) (fresh (x) (symbolo q) (== x q)) (not-pairo q))
'((_.0 (sym _.0))))
(test-check "not-pairo 11b"
(run 1 (q) (fresh (x) (numbero q) (== x q)) (not-pairo q))
'((_.0 (num _.0))))
(test-check "not-pairo 12"
(run 1 (q) (fresh (x) (not-pairo q) (== x q)) (symbolo q))
'((_.0 (sym _.0))))
(test-check "not-pairo 12b"
(run 1 (q) (fresh (x) (not-pairo q) (== x q)) (numbero q))
'((_.0 (num _.0))))
(test-check "not-pairo 13"
(run 1 (q) (not-pairo #f))
'(_.0))
(test-check "not-pairo 14"
(run 1 (q) (not-pairo 5))
'(_.0))
(test-check "not-pairo 15"
(run 1 (q) (== q #f) (not-pairo q))
'(#f))
(test-check "not-pairo 16"
(run 1 (q) (== q '()) (not-pairo q))
'(()))
(test-check "not-pairo 17"
(run 1 (a) (fresh (b c) (== b a) (== c a) (not-pairo c) (symbolo b)))
'((_.0 (sym _.0))))