forked from tip-org/benchmarks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OMakefile
157 lines (128 loc) · 7.05 KB
/
OMakefile
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
VERSION = 0.2
all: all-benchmarks
tar vczf tip-benchmarks-$(VERSION).tar.gz benchmarks/*
tar vczf tip-benchmarks-$(VERSION)-why3.tar.gz benchmarks-why3/*
tar vczf tip-benchmarks-$(VERSION)-smtlib.tar.gz benchmarks-smtlib/*
benchmarks_readme[] =
This archive contains the TIP benchmarks.
smtlib_readme[] =
This archive contains the TIP benchmarks, converted into SMTLIB format
version 2.6. All polymorphism has been eliminated from the problems,
in a possibly incomplete manner.
why3_readme[] =
This archive contains the TIP benchmarks, converted into WhyML format.
Some benchmarks fail the Why3 termination checker.
common_readme[]=
The benchmarks are organised into the following subdirectories:
* prod - from Productive Use of Failure in Inductive Proof, Ireland & Bundy
* isaplanner - test problems from the IsaPlanner project
* tip2015 - the new TIP benchmarks
* grammars - proving unambiguity of context-free grammars
* false - false properties for benchmarking of counterexample-finding tools
write_readme(dir, prelude) =
mkdir -p $(dir)
f=$(fopen $(dir)/README, w)
foreach(line => ..., $(prelude))
fprintln($f, $(line))
fprintln($f, $(EMPTY))
foreach(line => ..., $(common_readme))
fprintln($f, $(line))
close($f)
shell(cp LICENSE $(dir))
write_readme(benchmarks, $(benchmarks_readme))
write_readme(benchmarks-smtlib, $(smtlib_readme))
write_readme(benchmarks-why3, $(why3_readme))
commentify = $(file Commentify)
Commentify: Commentify.hs
stack exec -- ghc --make -O $@
tip-tools = $(file $(which tip-ghc)) $(file $(which tip))
clean:
rm -r benchmarks benchmarks-why3 benchmarks-smtlib
find-props(prop, file) =
props[] =
lex-search($(file))
case $"^$(prop)[^ ]*"
props[] += $0
export
return $(set $(props))
options=--drop-attribute source --drop-attribute let --drop-attribute tuple --drop-attribute keep --drop-attribute definition --drop-attribute axiom
create(prop_base, orig_dir, dest_dir, source, target_base) =
source=$(file original/$(orig_dir)/$(source))
foreach(prop => ..., $(find-props $(prop_base), $(source)))
name=$(dest_dir)/$(target_base)_$(removeprefix $(prop_base), $(prop))
tip=$(file benchmarks/$(name).smt2)
smt2=$(file benchmarks-smtlib/$(name).smt2)
why3=$(file benchmarks-why3/$(name).mlw)
all-benchmarks: $(tip) $(smt2) $(why3)
only-benchmarks: $(tip)
mkdir(-p $(dirname $(tip)))
.SUBDIRS: $(dirname $(source))
$(tip): $(source) $(commentify) $(tip-tools)
($(commentify) $< "$(prop)" "; " "; " ""; tip-ghc $< -k "$(prop)" | tip $(options) | tip --simplify-gently --csematch) > $@
mkdir(-p $(dirname $(smt2)))
$(smt2): $(tip) $(tip-tools)
($(commentify) $< "$(prop)" "; " "; " ""; tip $< --smtlib) > $@
mkdir(-p $(dirname $(why3)))
$(why3): $(tip) $(tip-tools)
($(commentify) $< "$(prop)" "(* " " * " " *)"; tip $< --why) > $@
check: $(why3)
why3 prove $< > /dev/null || true
section
options=--int-to-nat --simplify-gently --add-match --commute-match --simplify-gently $(options)
create(prop_, tip2015, tip2015, Nat.hs, nat)
create(prop_, tip2015, tip2015, WeirdNat.hs, weird_nat)
create(prop_, tip2015, tip2015, Fermat.hs, fermat)
create(prop_, tip2015, tip2015, Mod.hs, mod)
create(prop_, tip2015, tip2015, ModRotate.hs, rotate)
create(prop_, tip2015, tip2015, SnocRotate.hs, rotate)
create(prop_, tip2015, tip2015, SelfRotate.hs, rotate)
create(prop_, tip2015, tip2015, Integers.hs, int)
create(prop_, tip2015, tip2015, BinLists.hs, bin_nat)
create(prop_, koen, tip2015, List.hs, list_nat)
create(prop_, koen, tip2015, Sort.hs, sort_nat)
create(prop_, tip2015, tip2015, Escape.hs, escape)
create(prop_, tip2015, tip2015, BinLists.hs, bin)
create(prop_, tip2015, tip2015, Nicomachus.hs, nicomachus)
create(prop_, tip2015, tip2015, RegExp.hs, regexp)
create(prop_, tip2015, tip2015, ListMonad.hs, list)
create(prop_, tip2015, tip2015, RelaxedPrefix.hs, relaxedprefix)
create(prop_, tip2015, tip2015, Seq.hs, polyrec_seq)
create(prop_T, prod, prod, Properties.hs, prop)
create(prop_, isaplanner, isaplanner, Properties.hs, prop)
create(prop_, grammars, grammars, SimpleExpr1.hs, simp_expr)
create(prop_, grammars, grammars, SimpleExpr2.hs, simp_expr)
create(prop_, grammars, grammars, SimpleExpr3.hs, simp_expr)
create(prop_, grammars, grammars, SimpleExpr4.hs, simp_expr)
create(prop_, grammars, grammars, SimpleExpr5.hs, simp_expr)
create(prop_, grammars, grammars, Packrat.hs, packrat)
create(prop_, koen, tip2015, List.hs, list)
create(prop_, koen, tip2015, McCarthy91.hs, mccarthy91)
create(prop_, koen, tip2015, Propositional.hs, propositional)
create(prop_, koen, tip2015, Sort.hs, sort)
create(prop_, koen, tip2015, Subst.hs, subst)
create(prop_, koen, tip2015, Tree.hs, tree)
create(prop_, false, false, CFG5.hs, cfg5)
create(prop_, false, false, Definitions.hs, productive_use_of_failure)
create(prop_, false, false, Deriv.hs, derivative)
create(prop_, false, false, EditDistance.hs, edit_distance)
create(prop_, false, false, Expr.hs, expr)
create(prop_, false, false, Graph.hs, graph)
create(prop_, false, false, HotelKey_ReachAsDatatype.hs, hotel_key)
create(prop_, false, false, Imp.hs, imperative)
create(prop_, false, false, Kaleidoscope.hs, kaleidoscope)
create(prop_, false, false, Mergesort.hs, mergesort)
create(prop_, false, false, Nat.hs, nat)
create(prop_, false, false, Palin.hs, palindrome)
create(prop_, false, false, Parse.hs, parse)
create(prop_, false, false, Queue1.hs, queue1)
create(prop_, false, false, Queue2.hs, queue2)
create(prop_, false, false, Queue3.hs, queue3)
create(prop_, false, false, Rec.hs, rec)
create(prop_, false, false, RegExpDeluxe.hs, regexp_deluxe)
create(prop_, false, false, RegExp.hs, regexp)
create(prop_, false, false, Scale.hs, scale)
create(prop_, false, false, ShowBinLists.hs, show_bin_lists)
create(prop_, false, false, Sudoku.hs, sudoku)
create(prop_, false, false, Turing.hs, turing)
create(prop_, false, false, Type.hs, type)
create(prop_, false, false, Untyped.hs, untyped)