-
Notifications
You must be signed in to change notification settings - Fork 4
/
benchmarks.pro
73 lines (58 loc) · 1.35 KB
/
benchmarks.pro
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
% benchmarks prover P on terms of size N
xbm0:-xbm(10,12).
xbm:-tell('bm.txt'),xbm(13,15),told.
xbm(From,To):-
member(P,[lprove,bprove,sprove,pprove,hprove,dprove]),
nl,between(From,To,N),
bm(N,P),
fail
%; nl,P=dprove,between(From,To,N),
% timed_call(10,bm(N,P),Time),
% (number(Time)->true;ppp(P=Time)),
% fail
%; member(P,[kprove,gprove,tautology]),
% nl,between(From,To,N),
% cbm(N,P),
% fail
; nl,writeln(done).
xcbm(From,To):-
member(P,[lprove,bprove,sprove,pprove,hprove,dprove]),
nl,between(From,To,N),
cbm(N,P),
fail
; nl,writeln(done).
timed_call(Secs,Goal,Time):-
get_time(T0),
catch(
call_with_time_limit(Secs,Goal),
Exc,
true
),
get_time(T1),
(
var(Exc) -> Time is T1-T0
; Exc==time_limit_exceeded->Time = timeout(Secs)
; Time=Exc
).
% test against Fitting's prover as gold standard
% needs replacing the reduced one with :-include(..orig...)
% ?-cntest(6,taut).
% >-cntest(6,cprove).
cntest(N,P):-
allClassFormulas(N,T), %ppp(T),
( call(P,T) -> \+tautology(T),ppp(false_pos(T))
; dprove(T) -> tautology(T),ppp(false_neg(T))
),
fail
; true.
% benchmark against large random terms
rnbm:-rnbm(dprove).
% replicable large random types
rnbm(P):-
rnbm(101,500,2000,100,P,Time),
ppp(Time).
rnbm(Seed,N,K,Trim,P,Time):-
time(
rntest(Trim,fail,Seed,N,K,P),
Time
).