-
Notifications
You must be signed in to change notification settings - Fork 0
/
HerbrandTest.lean
311 lines (288 loc) · 14.2 KB
/
HerbrandTest.lean
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
import ReckonLean.Fol
import ReckonLean.Herbrand
/--
The "drinkers principle"; there exists a person `x` such that if `x` drinks then everyone does.
This is Pelletier no. 18:
In any given interpretation, either the consequent of the inner implication is always true, in
which case the formula holds, or there is some domain value `x` such that the antecedant is false,
and again the implication holds.
-/
def p18: Formula Fol := <|"exists x. forall y. P(x) ==> P(y)"|>
-- step by step through Gilmore
-- 1. there are no free variables, so generalization is a no-op
#guard print_fol (generalize p18) == "exists x. forall y. P(x) ==> P(y)"
-- 2. negation and skolemization leaves a quantifier-free formula we want to prove is unsat
def p18_to_check := skolemize (.Not (generalize p18))
#guard print_fol p18_to_check == "P(x) ∧ ~P(f_y(x))"
-- 3. the Herbrand universe is generated by a made up constant `c` and a single unary function `f_y`.
#guard herbfuncs p18_to_check == ([("c", 0)], [("f_y", 1)])
-- 4. Gilmore loop
--
-- Level 0 of the ground instance enumeration has only `P(c) ∧ ~P(f_y(c))`. The propositional atoms
-- here are `c` and `f_y(c)` and there are clear interpretations of `P` and `f_y` under which the
-- formula is SAT.
--
-- Level 1 of the enumeration yields `P(f_y(c)) ∧ ~P(f_y(f_y(c)))`, but then the conjunction of this
-- with level 0 is unsatisfiable because we have conjoined literals with different polarity:
--
-- `P(c) ∧ ~P(f_y(c)) ∧ P(f_y(c)) ∧ ~P(f_y(f_y(c)))`
--
-- Trace:
-- ======
--
-- 0 instances ground tried; 1 items in list
-- current conjunction: [[]]
-- ground instances tried: []
-- ground instances to go: []
--
-- 0 instances ground tried; 1 items in list
-- current conjunction: [[]]
-- ground instances tried: []
-- ground instances to go: [[c]]
--
-- 1 instances ground tried; 1 items in list
-- current conjunction: [[P(c), ~P(f_y(c))]]
-- ground instances tried: [[c]]
-- ground instances to go: []
--
-- 1 instances ground tried; 1 items in list
-- current conjunction: [[P(c), ~P(f_y(c))]]
-- ground instances tried: [[c]]
-- ground instances to go: [[f_y(c)]]
--
-- Assert that easy_validity_ex is valid and Gilmore required 2 ground instances to prove it.
-- #guard gilmore easy_unsat_ex == 2
/--
Pelletier problem no. 20
-/
def p20 :=
<|"(forall x y. exists z. forall w. (P(x) ∧ Q(y)) ==>
(R(z) ∧ S(w))) ==>
(exists x y. (P(x) ∧ Q(y))) ==> exists z. R(z)"|>
def p20_to_check := skolemize (.Not (generalize p20))
-- Agrees with Pelletier ✓
#guard print_fol_sets (CNF.simpcnf p20_to_check) ==
[["P(c_x)"],
["Q(c_y)"],
["R(f_z(x, y))", "~P(x)", "~Q(y)"],
["S(w)", "~P(x)", "~Q(y)"],
["~R(x)"]]
/--
Pelletier problem 24
One of the "tedious monadic logic problems from Kalish and Montague (1964)".
-/
def p24 :=
<|"~(exists x. S(x) ∧ Q(x)) ∧
(forall x. P(x) ==> Q(x) ∨ R(x)) ∧
(~(exists x. P(x)) ==> (exists x. Q(x))) ∧
(forall x. Q(x) ∨ R(x) ==> S(x))
==> (exists x. P(x) ∧ R(x))"|>
def p24_to_check := skolemize (.Not (generalize p24))
-- #eval print_fol p24_to_check
-- #eval print_fol_sets (DNF.simpdnf p24_to_check)
-- CNF of the formula to check matches Pelletier's answer exactly
#guard print_fol_sets (CNF.simpcnf p24_to_check) ==
[["P(c_x)", "Q(c_x')"],
["Q(x)", "R(x)", "~P(x)"],
["S(x)", "~Q(x)"],
["S(x)", "~R(x)"],
["~P(x)", "~R(x)"],
["~Q(x)", "~S(x)"]]
/--
Pelletier problem no. 35.
Start of the section on "Full Predicate Logic Without Identity and Functions".
Problem 35 is a test for checking that quantifiers are handled correctly.
-/
def p35 :=
<|"exists x y. P(x,y) ==> forall x y. P(x,y)"|>
def p35_to_check := skolemize (.Not (generalize p35))
#guard print_fol p35_to_check == "P(x, y) ∧ ~P(c_x, c_y)"
-- CNF of the formula to check is a better version of Pelletier's answer,
-- but first-order logically equivalent under the mapping (c_x |-> f(x,y))(c_y |-> g(x,y))
#guard print_fol_sets (CNF.simpcnf p35_to_check) ==
[["P(x, y)"], ["~P(c_x, c_y)"]]
-- Pelletier problem no. 45
def p45 :=
<|"(forall x. P(x) ∧ (forall y. G(y) ∧ H(x,y) ==> J(x,y)) ==> (forall y. G(y) ∧ H(x,y) ==> R(y))) ∧
~(exists y. L(y) ∧ R(y)) ∧
(exists x. P(x) ∧ (forall y. H(x,y) ==> L(y)) ∧ (forall y. G(y) ∧ H(x,y) ==> J(x,y)))
==> (exists x. P(x) ∧ ~(exists y. G(y) ∧ H(x,y)))"|>
def p45_to_check := skolemize (.Not (generalize p45))
/-
Us:
(((~P(x) ∨ (G(f_y(x)) ∧ H(x, f_y(x))) ∧ ~J(x, f_y(x))) ∨
(~G(y) ∨ ~H(x, y)) ∨
R(y)) ∧
(~L(x) ∨ ~R(x)) ∧
P(c_x) ∧
(~H(c_x, x) ∨ L(x)) ∧
((~G(x) ∨ ~H(c_x, x)) ∨ J(c_x, x))) ∧
(~P(x) ∨ G(f_y'(x)) ∧ H(x, f_y'(x)))
Handbook:
(((~P(x) \/ (G(f_y(x)) /\ H(x,f_y(x))) /\ ~J(x,f_y(x))) \/
(~G(y) \/ ~H(x,y)) \/
R(y)) /\
(~L(x) \/ ~R(x)) /\
P(c_x) /\
(~H(c_x,x) \/ L(x)) /\
((~G(x) \/ ~H(c_x,x)) \/ J(c_x,x))) /\
(~P(x) \/ G(f_y'(x)) /\ H(x,f_y'(x)))
Formulas agree! ✓
-/
#guard print_fol p45_to_check ==
"(((~P(x) ∨ (G(f_y(x)) ∧ H(x, f_y(x))) ∧ ~J(x, f_y(x))) ∨ (~G(y) ∨ ~H(x, y)) ∨ R(y)) ∧ (~L(x) ∨ ~R(x)) ∧ P(c_x) ∧ (~H(c_x, x) ∨ L(x)) ∧ ((~G(x) ∨ ~H(c_x, x)) ∨ J(c_x, x))) ∧ (~P(x) ∨ G(f_y'(x)) ∧ H(x, f_y'(x)))"
/-
Debugging info for `gilmore p45` that appear to be incorrect on `ade0919`
Us: DNF rep has 90 disjuncts
[G(f_y(x)), G(f_y'(x)), H(x, f_y(x)), H(x, f_y'(x)), J(c_x, x), L(x), P(c_x), ~J(x, f_y(x)), ~R(x)],
[G(f_y(x)), G(f_y'(x)), H(x, f_y(x)), H(x, f_y'(x)), J(c_x, x), P(c_x), ~H(c_x, x), ~J(x, f_y(x)), ~L(x)],
[G(f_y(x)), G(f_y'(x)), H(x, f_y(x)), H(x, f_y'(x)), J(c_x, x), P(c_x), ~H(c_x, x), ~J(x, f_y(x)), ~R(x)],
[G(f_y(x)), G(f_y'(x)), H(x, f_y(x)), H(x, f_y'(x)), L(x), P(c_x), ~G(x), ~J(x, f_y(x)), ~R(x)],
[G(f_y(x)), G(f_y'(x)), H(x, f_y(x)), H(x, f_y'(x)), L(x), P(c_x), ~H(c_x, x), ~J(x, f_y(x)), ~R(x)],
[G(f_y(x)), G(f_y'(x)), H(x, f_y(x)), H(x, f_y'(x)), P(c_x), ~G(x), ~H(c_x, x), ~J(x, f_y(x)), ~L(x)],
[G(f_y(x)), G(f_y'(x)), H(x, f_y(x)), H(x, f_y'(x)), P(c_x), ~G(x), ~H(c_x, x), ~J(x, f_y(x)), ~R(x)],
[G(f_y(x)), G(f_y'(x)), H(x, f_y(x)), H(x, f_y'(x)), P(c_x), ~H(c_x, x), ~J(x, f_y(x)), ~L(x)],
[G(f_y(x)), G(f_y'(x)), H(x, f_y(x)), H(x, f_y'(x)), P(c_x), ~H(c_x, x), ~J(x, f_y(x)), ~R(x)],
[G(f_y(x)), H(x, f_y(x)), J(c_x, x), L(x), P(c_x), ~J(x, f_y(x)), ~P(x), ~R(x)],
[G(f_y(x)), H(x, f_y(x)), J(c_x, x), P(c_x), ~H(c_x, x), ~J(x, f_y(x)), ~L(x), ~P(x)],
[G(f_y(x)), H(x, f_y(x)), J(c_x, x), P(c_x), ~H(c_x, x), ~J(x, f_y(x)), ~P(x), ~R(x)],
[G(f_y(x)), H(x, f_y(x)), L(x), P(c_x), ~G(x), ~J(x, f_y(x)), ~P(x), ~R(x)],
[G(f_y(x)), H(x, f_y(x)), L(x), P(c_x), ~H(c_x, x), ~J(x, f_y(x)), ~P(x), ~R(x)],
[G(f_y(x)), H(x, f_y(x)), P(c_x), ~G(x), ~H(c_x, x), ~J(x, f_y(x)), ~L(x), ~P(x)],
[G(f_y(x)), H(x, f_y(x)), P(c_x), ~G(x), ~H(c_x, x), ~J(x, f_y(x)), ~P(x), ~R(x)],
[G(f_y(x)), H(x, f_y(x)), P(c_x), ~H(c_x, x), ~J(x, f_y(x)), ~L(x), ~P(x)],
[G(f_y(x)), H(x, f_y(x)), P(c_x), ~H(c_x, x), ~J(x, f_y(x)), ~P(x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), L(x), P(c_x), R(y), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), L(x), P(c_x), ~G(y), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), L(x), P(c_x), ~H(x, y), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), L(x), P(c_x), ~P(x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), P(c_x), R(y), ~H(c_x, x), ~L(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), P(c_x), R(y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), P(c_x), ~G(y), ~H(c_x, x), ~L(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), P(c_x), ~G(y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), P(c_x), ~H(x, y), ~H(c_x, x), ~L(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), P(c_x), ~H(x, y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), P(c_x), ~H(c_x, x), ~L(x), ~P(x)],
[G(f_y'(x)), H(x, f_y'(x)), J(c_x, x), P(c_x), ~H(c_x, x), ~P(x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), L(x), P(c_x), R(y), ~G(x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), L(x), P(c_x), R(y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), L(x), P(c_x), ~G(x), ~G(y), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), L(x), P(c_x), ~G(x), ~H(x, y), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), L(x), P(c_x), ~G(x), ~P(x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), L(x), P(c_x), ~G(y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), L(x), P(c_x), ~H(x, y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), L(x), P(c_x), ~H(c_x, x), ~P(x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), R(y), ~G(x), ~H(c_x, x), ~L(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), R(y), ~G(x), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), R(y), ~H(c_x, x), ~L(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), R(y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~G(x), ~G(y), ~H(c_x, x), ~L(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~G(x), ~G(y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~G(x), ~H(x, y), ~H(c_x, x), ~L(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~G(x), ~H(x, y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~G(x), ~H(c_x, x), ~L(x), ~P(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~G(x), ~H(c_x, x), ~P(x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~G(y), ~H(c_x, x), ~L(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~G(y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~H(x, y), ~H(c_x, x), ~L(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~H(x, y), ~H(c_x, x), ~R(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~H(c_x, x), ~L(x), ~P(x)],
[G(f_y'(x)), H(x, f_y'(x)), P(c_x), ~H(c_x, x), ~P(x), ~R(x)],
[J(c_x, x), L(x), P(c_x), R(y), ~P(x), ~R(x)],
[J(c_x, x), L(x), P(c_x), ~G(y), ~P(x), ~R(x)],
[J(c_x, x), L(x), P(c_x), ~H(x, y), ~P(x), ~R(x)],
[J(c_x, x), L(x), P(c_x), ~P(x), ~R(x)],
[J(c_x, x), P(c_x), R(y), ~H(c_x, x), ~L(x), ~P(x)],
[J(c_x, x), P(c_x), R(y), ~H(c_x, x), ~P(x), ~R(x)],
[J(c_x, x), P(c_x), ~G(y), ~H(c_x, x), ~L(x), ~P(x)],
[J(c_x, x), P(c_x), ~G(y), ~H(c_x, x), ~P(x), ~R(x)],
[J(c_x, x), P(c_x), ~H(x, y), ~H(c_x, x), ~L(x), ~P(x)],
[J(c_x, x), P(c_x), ~H(x, y), ~H(c_x, x), ~P(x), ~R(x)],
[J(c_x, x), P(c_x), ~H(c_x, x), ~L(x), ~P(x)],
[J(c_x, x), P(c_x), ~H(c_x, x), ~P(x), ~R(x)],
[L(x), P(c_x), R(y), ~G(x), ~P(x), ~R(x)],
[L(x), P(c_x), R(y), ~H(c_x, x), ~P(x), ~R(x)],
[L(x), P(c_x), ~G(x), ~G(y), ~P(x), ~R(x)],
[L(x), P(c_x), ~G(x), ~H(x, y), ~P(x), ~R(x)],
[L(x), P(c_x), ~G(x), ~P(x), ~R(x)],
[L(x), P(c_x), ~G(y), ~H(c_x, x), ~P(x), ~R(x)],
[L(x), P(c_x), ~H(x, y), ~H(c_x, x), ~P(x), ~R(x)],
[L(x), P(c_x), ~H(c_x, x), ~P(x), ~R(x)],
[P(c_x), R(y), ~G(x), ~H(c_x, x), ~L(x), ~P(x)],
[P(c_x), R(y), ~G(x), ~H(c_x, x), ~P(x), ~R(x)],
[P(c_x), R(y), ~H(c_x, x), ~L(x), ~P(x)],
[P(c_x), R(y), ~H(c_x, x), ~P(x), ~R(x)],
[P(c_x), ~G(x), ~G(y), ~H(c_x, x), ~L(x), ~P(x)],
[P(c_x), ~G(x), ~G(y), ~H(c_x, x), ~P(x), ~R(x)],
[P(c_x), ~G(x), ~H(x, y), ~H(c_x, x), ~L(x), ~P(x)], <--|
[P(c_x), ~G(x), ~H(x, y), ~H(c_x, x), ~P(x), ~R(x)], |
[P(c_x), ~G(x), ~H(c_x, x), ~L(x), ~P(x)], |-- subsumed!
[P(c_x), ~G(x), ~H(c_x, x), ~P(x), ~R(x)], |
[P(c_x), ~G(y), ~H(c_x, x), ~L(x), ~P(x)], <------------|
[P(c_x), ~G(y), ~H(c_x, x), ~P(x), ~R(x)],
[P(c_x), ~H(x, y), ~H(c_x, x), ~L(x), ~P(x)], <--|
[P(c_x), ~H(x, y), ~H(c_x, x), ~P(x), ~R(x)], <--| |- subsumed!
[P(c_x), ~H(c_x, x), ~L(x), ~P(x)], |- subsumed! <--|
[P(c_x), ~H(c_x, x), ~P(x), ~R(x)] <--|
Handbook: DNF rep has 20 disjuncts
[G(f_y(x)), G(f_y'(x)), H(x,f_y(x)), H(x,f_y'(x)), J(c_x,x), L(x), P(c_x), ~J(x,f_y(x)), ~R(x)],
[G(f_y(x)), G(f_y'(x)), H(x,f_y(x)), H(x,f_y'(x)), L(x), P(c_x), ~G(x), ~J(x,f_y(x)), ~R(x)],
[G(f_y(x)), G(f_y'(x)), H(x,f_y(x)), H(x,f_y'(x)), P(c_x), ~H(c_x,x), ~J(x,f_y(x)), ~L(x)],
[G(f_y(x)), G(f_y'(x)), H(x,f_y(x)), H(x,f_y'(x)), P(c_x), ~H(c_x,x), ~J(x,f_y(x)), ~R(x)],
[G(f_y'(x)), H(x,f_y'(x)), J(c_x,x), L(x), P(c_x), R(y), ~R(x)],
[G(f_y'(x)), H(x,f_y'(x)), J(c_x,x), L(x), P(c_x), ~G(y), ~R(x)],
[G(f_y'(x)), H(x,f_y'(x)), J(c_x,x), L(x), P(c_x), ~H(x,y), ~R(x)],
[G(f_y'(x)), H(x,f_y'(x)), L(x), P(c_x), R(y), ~G(x), ~R(x)],
[G(f_y'(x)), H(x,f_y'(x)), L(x), P(c_x), ~G(x), ~G(y), ~R(x)],
[G(f_y'(x)), H(x,f_y'(x)), L(x), P(c_x), ~G(x), ~H(x,y), ~R(x)],
[G(f_y'(x)), H(x,f_y'(x)), P(c_x), R(y), ~H(c_x,x), ~L(x)],
[G(f_y'(x)), H(x,f_y'(x)), P(c_x), R(y), ~H(c_x,x), ~R(x)],
[G(f_y'(x)), H(x,f_y'(x)), P(c_x), ~G(y), ~H(c_x,x), ~L(x)],
[G(f_y'(x)), H(x,f_y'(x)), P(c_x), ~G(y), ~H(c_x,x), ~R(x)],
[G(f_y'(x)), H(x,f_y'(x)), P(c_x), ~H(x,y), ~H(c_x,x), ~L(x)],
[G(f_y'(x)), H(x,f_y'(x)), P(c_x), ~H(x,y), ~H(c_x,x), ~R(x)],
[J(c_x,x), L(x), P(c_x), ~P(x), ~R(x)],
[L(x), P(c_x), ~G(x), ~P(x), ~R(x)],
[P(c_x), ~H(c_x,x), ~L(x), ~P(x)],
[P(c_x), ~H(c_x,x), ~P(x), ~R(x)]
-/
#guard (DNF.simpdnf p45_to_check).length == 20
-- The clausal representation of the formula to be checked agrees exactly with
-- Pelletier's translation of no. 45 to skolemized CNF. Also agrees with the Handbook's
-- answer ✓
#guard print_fol_sets (CNF.simpcnf p45_to_check) ==
[["G(f_y(x))", "R(y)", "~G(y)", "~H(x, y)", "~P(x)"],
["G(f_y'(x))", "~P(x)"],
["H(x, f_y(x))", "R(y)", "~G(y)", "~H(x, y)", "~P(x)"],
["H(x, f_y'(x))", "~P(x)"],
["J(c_x, x)", "~G(x)", "~H(c_x, x)"],
["L(x)", "~H(c_x, x)"],
["P(c_x)"],
["R(y)", "~G(y)", "~H(x, y)", "~J(x, f_y(x))", "~P(x)"],
["~L(x)", "~R(x)"]]
def test_cases : List (String × Formula Fol × String × (Formula Fol → Nat)) :=
[
-- Gilmore Procedure
("p18", p18, "gilmore", gilmore),
("p24", p24, "gilmore", gilmore),
("p35", p35, "gilmore", gilmore),
("p45", p45, "gilmore", gilmore), -- starbuck (Lean v4.6.0): 413,589,917 ns
-- `gilmore p20` gets to: n=2, |tried|=34 ground instances tried; |fl| = 20060 disj/conj
-- and then stalls out due to the exposion of disjuncts
-- ("p20", p20, "gilmore", gilmore),
-- Davis-Putnum Procedure
("p18", p18, "davisputnam", davisputnam),
("p24", p24, "davisputnam", davisputnam),
("p35", p35, "davisputnam", davisputnam),
("p45", p45, "davisputnam", davisputnam), -- starbuck (Lean v4.6.0): 77,083 ns
("p20", p20, "davisputnam", davisputnam), -- starbuck (Lean v4.6.0): 35,083 ns
]
def main : IO Unit := do
List.forM test_cases (fun (name, fm, tester_name, tester) => do
IO.println s!"Solving {name} ({tester_name})"
let start <- IO.monoNanosNow
let res := tester fm
let end_ <- IO.monoNanosNow
IO.println s!"Done: no. instances tried {res}. Duration {end_ - start} ns"
IO.println "----"
)