author | bulwahn |
Fri, 03 Jun 2011 19:37:26 +0200 | |
changeset 43153 | cbb748ccf81b |
parent 43152 | 6c4e021dec06 |
child 43334 | 9970a4580d13 |
permissions | -rw-r--r-- |
41542 | 1 |
""" |
2 |
Test configuration descriptions for mira. |
|
3 |
""" |
|
4 |
||
5 |
import os |
|
6 |
from os import path |
|
7 |
from glob import glob |
|
8 |
import subprocess |
|
42392 | 9 |
from datetime import datetime |
41542 | 10 |
import re |
11 |
||
12 |
import util |
|
42392 | 13 |
from util import Lazy |
41542 | 14 |
|
42392 | 15 |
from mira.report import Report, Report_Content |
16 |
from mira.case import Case |
|
17 |
from mira.tools import tool |
|
42823 | 18 |
from mira import schedule, misc |
42192 | 19 |
from mira.environment import scheduler |
20 |
||
41542 | 21 |
|
22 |
# build and evaluation tools |
|
23 |
||
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
24 |
default_usedir_options = "$ISABELLE_USEDIR_OPTIONS -d pdf -g true -i true -t true" |
41542 | 25 |
|
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
26 |
def prepare_isabelle_repository(loc_isabelle, loc_contrib, loc_dependency_heaps, |
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
27 |
usedir_options=default_usedir_options, more_settings=''): |
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
28 |
|
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
29 |
# prepare components |
41542 | 30 |
loc_contrib = path.expanduser(loc_contrib) |
31 |
if not path.exists(loc_contrib): |
|
32 |
raise IOError('Bad file: %s' % loc_contrib) |
|
33 |
subprocess.check_call(['ln', '-s', loc_contrib, '%s/contrib' % loc_isabelle]) |
|
34 |
||
35 |
contributed_components = path.join(loc_isabelle, 'Admin', 'contributed_components') |
|
36 |
if path.exists(contributed_components): |
|
37 |
components = [] |
|
38 |
for component in util.readfile_lines(contributed_components): |
|
39 |
loc_component = path.join(loc_isabelle, component) |
|
40 |
if path.exists(loc_component): |
|
41 |
components.append(loc_component) |
|
42 |
writer = open(path.join(loc_isabelle, 'etc', 'components'), 'a') |
|
43 |
for component in components: |
|
44 |
writer.write(component + '\n') |
|
45 |
writer.close() |
|
46 |
||
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
47 |
# provide existing dependencies |
41542 | 48 |
if loc_dependency_heaps: |
49 |
isabelle_path = loc_dependency_heaps + '/$ISABELLE_IDENTIFIER:$ISABELLE_OUTPUT' |
|
50 |
else: |
|
51 |
isabelle_path = '$ISABELLE_OUTPUT' |
|
52 |
||
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
53 |
# patch settings |
41542 | 54 |
extra_settings = ''' |
55 |
ISABELLE_HOME_USER="$ISABELLE_HOME/home_user" |
|
56 |
ISABELLE_OUTPUT="$ISABELLE_HOME/heaps" |
|
57 |
ISABELLE_BROWSER_INFO="$ISABELLE_HOME/browser_info" |
|
58 |
ISABELLE_PATH="%s" |
|
59 |
||
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
60 |
ISABELLE_USEDIR_OPTIONS="%s" |
42109 | 61 |
Z3_NON_COMMERCIAL="yes" |
42113 | 62 |
%s |
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
63 |
''' % (isabelle_path, usedir_options, more_settings) |
41542 | 64 |
|
65 |
writer = open(path.join(loc_isabelle, 'etc', 'settings'), 'a') |
|
66 |
writer.write(extra_settings) |
|
67 |
writer.close() |
|
68 |
||
69 |
||
70 |
def extract_isabelle_run_timing(logdata): |
|
71 |
||
72 |
def to_secs(h, m, s): |
|
73 |
return (int(h) * 60 + int(m)) * 60 + int(s) |
|
74 |
pat = r'Finished (\S+) \((\d+):(\d+):(\d+) elapsed time, (\d+):(\d+):(\d+) cpu time' |
|
42186
bb688200b949
adapted parsing of session timing (cf. e86b10c68f0b)
krauss
parents:
42140
diff
changeset
|
75 |
pat2 = r'Timing (\S+) \((\d+) threads, (\d+\.\d+)s elapsed time, (\d+\.\d+)s cpu time, (\d+\.\d+)s GC time, factor (\d+\.\d+)\)' |
41542 | 76 |
t = dict((name, {'elapsed': to_secs(eh,em,es), 'cpu': to_secs(ch,cm,cs)}) |
77 |
for name, eh, em, es, ch, cm, cs in re.findall(pat, logdata)) |
|
42186
bb688200b949
adapted parsing of session timing (cf. e86b10c68f0b)
krauss
parents:
42140
diff
changeset
|
78 |
for name, threads, elapsed, cpu, gc, factor in re.findall(pat2, logdata): |
41542 | 79 |
|
80 |
if name not in t: |
|
81 |
t[name] = {} |
|
82 |
||
83 |
t[name]['threads'] = int(threads) |
|
84 |
t[name]['elapsed_inner'] = elapsed |
|
85 |
t[name]['cpu_inner'] = cpu |
|
86 |
t[name]['gc'] = gc |
|
42186
bb688200b949
adapted parsing of session timing (cf. e86b10c68f0b)
krauss
parents:
42140
diff
changeset
|
87 |
t[name]['factor'] = factor |
41542 | 88 |
|
89 |
return t |
|
90 |
||
91 |
||
92 |
def extract_isabelle_run_summary(logdata): |
|
93 |
||
41894 | 94 |
re_error = re.compile(r'^(?:make: )?\*\*\* (.*)$', re.MULTILINE) |
41542 | 95 |
summary = '\n'.join(re_error.findall(logdata)) |
96 |
if summary == '': |
|
97 |
summary = 'ok' |
|
98 |
||
99 |
return summary |
|
100 |
||
101 |
||
42392 | 102 |
@tool |
103 |
def import_isatest_log(env, conf, logfile): |
|
104 |
||
105 |
"""Imports isatest log file as a report.""" |
|
106 |
||
107 |
def the_match(pat, text, name): |
|
108 |
match = re.search(pat, text) |
|
109 |
if not match: raise Exception('No match found for ' + name) |
|
110 |
return match.groups() |
|
111 |
||
112 |
def parse_date(d): |
|
113 |
return datetime.strptime(d, '%a %b %d %H:%M:%S %Z %Y') |
|
114 |
||
115 |
log = util.readfile(logfile) |
|
116 |
||
117 |
(begin_date, host) = the_match(r'-+ starting test -+ ([^-]*) -+ (\S*)', log, 'start tag') |
|
118 |
(isabelle_version,) = the_match(r'Isabelle version: ([a-f0-9]{12})', log, 'Isabelle version') |
|
119 |
(success, end_date) = the_match(r'-+ test (successful|FAILED) -+ ([^-]*) -', log, 'end tag') |
|
120 |
summary = extract_isabelle_run_summary(log) |
|
121 |
data = {'timing': extract_isabelle_run_timing(log)} |
|
122 |
atts = {'log': Lazy.simple(log)} |
|
123 |
||
124 |
content = Report_Content(summary, host, parse_date(begin_date), |
|
125 |
parse_date(end_date), Lazy.simple(data), atts) |
|
126 |
revision = ('Isabelle', env.repositories.get('Isabelle')[isabelle_version].hex()) |
|
127 |
case = Case(conf, [revision]) |
|
128 |
||
129 |
env.report_db.put(case, (success == 'successful'), content) |
|
130 |
||
131 |
||
132 |
||
41542 | 133 |
def isabelle_usedir(env, isa_path, isabelle_usedir_opts, base_image, dir_name): |
134 |
||
135 |
return env.run_process('%s/bin/isabelle' % isa_path, 'usedir', |
|
136 |
isabelle_usedir_opts, base_image, dir_name) |
|
137 |
||
138 |
||
139 |
def isabelle_dependency_only(env, case, paths, dep_paths, playground): |
|
140 |
||
42114 | 141 |
isabelle_home = paths[0] |
142 |
result = path.join(isabelle_home, 'heaps') |
|
41542 | 143 |
os.makedirs(result) |
144 |
for dep_path in dep_paths: |
|
145 |
subprocess.check_call(['cp', '-R'] + glob(dep_path + '/*') + [result]) |
|
146 |
||
147 |
return (True, 'ok', {}, {}, result) |
|
148 |
||
149 |
||
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
150 |
def build_isabelle_image(subdir, base, img, env, case, paths, dep_paths, playground, |
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
151 |
usedir_options=default_usedir_options, more_settings=''): |
41542 | 152 |
|
42114 | 153 |
isabelle_home = paths[0] |
41542 | 154 |
dep_path = dep_paths[0] |
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
155 |
prepare_isabelle_repository(isabelle_home, env.settings.contrib, dep_path, |
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
156 |
usedir_options=usedir_options, more_settings=more_settings) |
42114 | 157 |
os.chdir(path.join(isabelle_home, 'src', subdir)) |
41542 | 158 |
|
42114 | 159 |
(return_code, log) = isabelle_usedir(env, isabelle_home, '-b', base, img) |
41542 | 160 |
|
42114 | 161 |
result = path.join(isabelle_home, 'heaps') |
41542 | 162 |
return (return_code == 0, extract_isabelle_run_summary(log), |
163 |
{'timing': extract_isabelle_run_timing(log)}, {'log': log}, result) |
|
164 |
||
165 |
||
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
166 |
def isabelle_make(subdir, env, case, paths, dep_paths, playground, usedir_options=default_usedir_options, |
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
167 |
more_settings='', target='all', keep_results=False): |
42115
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
168 |
|
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
169 |
isabelle_home = paths[0] |
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
170 |
dep_path = dep_paths[0] if dep_paths else None |
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
171 |
prepare_isabelle_repository(isabelle_home, env.settings.contrib, dep_path, |
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
172 |
usedir_options=usedir_options, more_settings=more_settings) |
42115
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
173 |
os.chdir(path.join(isabelle_home, subdir)) |
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
174 |
|
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
175 |
(return_code, log) = env.run_process('%s/bin/isabelle' % isabelle_home, 'make', '-k', target) |
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
176 |
|
42140 | 177 |
result = path.join(isabelle_home, 'heaps') if keep_results else None |
42115
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
178 |
return (return_code == 0, extract_isabelle_run_summary(log), |
42140 | 179 |
{'timing': extract_isabelle_run_timing(log)}, {'log': log}, result) |
42115
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
180 |
|
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
181 |
|
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
182 |
def isabelle_makeall(env, case, paths, dep_paths, playground, usedir_options=default_usedir_options, |
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
183 |
more_settings='', target='all', make_options=()): |
41542 | 184 |
|
42823 | 185 |
# FIXME!? |
186 |
if 'lxbroy10' in misc.hostnames(): |
|
187 |
make_options += ('-j', '8') |
|
188 |
usedir_options += " -M 6 -q 2 -i false -d false" |
|
189 |
more_settings += ''' |
|
190 |
ML_PLATFORM="x86_64-linux" |
|
191 |
ML_HOME="/home/polyml/polyml-svn/x86_64-linux" |
|
192 |
ML_SYSTEM="polyml-5.4.1" |
|
193 |
ML_OPTIONS="-H 8000 --gcthreads 6" |
|
194 |
''' |
|
195 |
||
42114 | 196 |
isabelle_home = paths[0] |
42115
e6a1dc0aa058
mira interface to 'isabelle make' in addition to usedir and makeall;
krauss
parents:
42114
diff
changeset
|
197 |
dep_path = dep_paths[0] if dep_paths else None |
42821
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
198 |
prepare_isabelle_repository(isabelle_home, env.settings.contrib, dep_path, |
4629cbaebc04
clarified handling of ISABELLE_USEDIR_OPTIONS in mira
krauss
parents:
42472
diff
changeset
|
199 |
usedir_options=usedir_options, more_settings=more_settings) |
42114 | 200 |
os.chdir(isabelle_home) |
41542 | 201 |
|
42121 | 202 |
(return_code, log) = env.run_process('%s/bin/isabelle' % isabelle_home, 'makeall', '-k', *(make_options + (target,))) |
41542 | 203 |
|
204 |
return (return_code == 0, extract_isabelle_run_summary(log), |
|
205 |
{'timing': extract_isabelle_run_timing(log)}, {'log': log}, None) |
|
206 |
||
207 |
||
208 |
# Isabelle configurations |
|
209 |
||
210 |
@configuration(repos = [Isabelle], deps = []) |
|
211 |
def Pure(env, case, paths, dep_paths, playground): |
|
212 |
"""Pure image""" |
|
213 |
||
42114 | 214 |
isabelle_home = paths[0] |
215 |
prepare_isabelle_repository(isabelle_home, env.settings.contrib, '') |
|
216 |
os.chdir(path.join(isabelle_home, 'src', 'Pure')) |
|
41542 | 217 |
|
42114 | 218 |
(return_code, log) = env.run_process('%s/bin/isabelle' % isabelle_home, 'make', 'Pure') |
41542 | 219 |
|
42114 | 220 |
result = path.join(isabelle_home, 'heaps') |
41542 | 221 |
return (return_code == 0, extract_isabelle_run_summary(log), |
222 |
{'timing': extract_isabelle_run_timing(log)}, {'log': log}, result) |
|
223 |
||
224 |
@configuration(repos = [Isabelle], deps = [(Pure, [0])]) |
|
225 |
def FOL(*args): |
|
226 |
"""FOL image""" |
|
227 |
return build_isabelle_image('FOL', 'Pure', 'FOL', *args) |
|
228 |
||
229 |
@configuration(repos = [Isabelle], deps = [(Pure, [0])]) |
|
230 |
def HOL(*args): |
|
231 |
"""HOL image""" |
|
232 |
return build_isabelle_image('HOL', 'Pure', 'HOL', *args) |
|
233 |
||
234 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
|
235 |
def HOL_HOLCF(*args): |
|
236 |
"""HOL-HOLCF image""" |
|
237 |
return build_isabelle_image('HOL/HOLCF', 'HOL', 'HOLCF', *args) |
|
238 |
||
239 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
|
240 |
def HOL_Nominal(*args): |
|
241 |
"""HOL-Nominal image""" |
|
242 |
return build_isabelle_image('HOL/Nominal', 'HOL', 'HOL-Nominal', *args) |
|
243 |
||
244 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
|
245 |
def HOL_Word(*args): |
|
246 |
"""HOL-Word image""" |
|
247 |
return build_isabelle_image('HOL/Word', 'HOL', 'HOL-Word', *args) |
|
248 |
||
249 |
@configuration(repos = [Isabelle], deps = [ |
|
250 |
(HOL, [0]), |
|
251 |
(HOL_HOLCF, [0]), |
|
252 |
(HOL_Nominal, [0]), |
|
253 |
(HOL_Word, [0]) |
|
254 |
]) |
|
255 |
def AFP_images(*args): |
|
256 |
"""Isabelle images needed for the AFP""" |
|
257 |
return isabelle_dependency_only(*args) |
|
258 |
||
42822
dc7232f0c303
no dependencies for Isabelle_makeall, which will be built in one go
krauss
parents:
42821
diff
changeset
|
259 |
@configuration(repos = [Isabelle], deps = []) |
41542 | 260 |
def Isabelle_makeall(*args): |
261 |
"""Isabelle makeall""" |
|
262 |
return isabelle_makeall(*args) |
|
263 |
||
264 |
||
265 |
# Mutabelle configurations |
|
266 |
||
267 |
def invoke_mutabelle(theory, env, case, paths, dep_paths, playground): |
|
268 |
||
269 |
"""Mutant testing for counterexample generators in Isabelle""" |
|
270 |
||
271 |
(loc_isabelle,) = paths |
|
272 |
(dep_isabelle,) = dep_paths |
|
43152
6c4e021dec06
adding more settings to mira's mutabelle configuration
bulwahn
parents:
42948
diff
changeset
|
273 |
more_settings = ''' |
43153
cbb748ccf81b
changing the mira setting again for the mutabelle configuration
bulwahn
parents:
43152
diff
changeset
|
274 |
ISABELLE_GHC="/usr/bin/ghc" |
43152
6c4e021dec06
adding more settings to mira's mutabelle configuration
bulwahn
parents:
42948
diff
changeset
|
275 |
''' |
6c4e021dec06
adding more settings to mira's mutabelle configuration
bulwahn
parents:
42948
diff
changeset
|
276 |
prepare_isabelle_repository(loc_isabelle, env.settings.contrib, dep_isabelle, |
6c4e021dec06
adding more settings to mira's mutabelle configuration
bulwahn
parents:
42948
diff
changeset
|
277 |
more_settings = more_settings) |
41542 | 278 |
os.chdir(loc_isabelle) |
279 |
||
280 |
(return_code, log) = env.run_process('bin/isabelle', |
|
281 |
'mutabelle', '-O', playground, theory) |
|
282 |
||
283 |
try: |
|
284 |
mutabelle_log = util.readfile(path.join(playground, 'log')) |
|
285 |
except IOError: |
|
286 |
mutabelle_log = '' |
|
287 |
||
42472 | 288 |
mutabelle_data = dict( |
289 |
(tool, {'counterexample': c, 'no_counterexample': n, 'timeout': t, 'error': e}) |
|
290 |
for tool, c, n, t, e in re.findall(r'(\S+)\s+: C: (\d+) N: (\d+) T: (\d+) E: (\d+)', log)) |
|
291 |
||
41542 | 292 |
return (return_code == 0 and mutabelle_log != '', extract_isabelle_run_summary(log), |
42472 | 293 |
{'mutabelle_results': {theory: mutabelle_data}}, |
41652 | 294 |
{'log': log, 'mutabelle_log': mutabelle_log}, None) |
41542 | 295 |
|
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
296 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
41542 | 297 |
def Mutabelle_Relation(*args): |
298 |
"""Mutabelle regression suite on Relation theory""" |
|
299 |
return invoke_mutabelle('Relation', *args) |
|
300 |
||
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
301 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
41542 | 302 |
def Mutabelle_List(*args): |
303 |
"""Mutabelle regression suite on List theory""" |
|
304 |
return invoke_mutabelle('List', *args) |
|
305 |
||
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
306 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
41542 | 307 |
def Mutabelle_Set(*args): |
308 |
"""Mutabelle regression suite on Set theory""" |
|
309 |
return invoke_mutabelle('Set', *args) |
|
310 |
||
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
311 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
41542 | 312 |
def Mutabelle_Map(*args): |
313 |
"""Mutabelle regression suite on Map theory""" |
|
314 |
return invoke_mutabelle('Map', *args) |
|
315 |
||
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
316 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
41542 | 317 |
def Mutabelle_Divides(*args): |
318 |
"""Mutabelle regression suite on Divides theory""" |
|
319 |
return invoke_mutabelle('Divides', *args) |
|
320 |
||
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
321 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
41542 | 322 |
def Mutabelle_MacLaurin(*args): |
323 |
"""Mutabelle regression suite on MacLaurin theory""" |
|
324 |
return invoke_mutabelle('MacLaurin', *args) |
|
325 |
||
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
326 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
41542 | 327 |
def Mutabelle_Fun(*args): |
328 |
"""Mutabelle regression suite on Fun theory""" |
|
329 |
return invoke_mutabelle('Fun', *args) |
|
42040 | 330 |
|
42393 | 331 |
mutabelle_confs = 'Mutabelle_Relation Mutabelle_List Mutabelle_Set Mutabelle_Map Mutabelle_Divides Mutabelle_MacLaurin Mutabelle_Fun'.split(' ') |
332 |
||
333 |
@scheduler() |
|
334 |
def mutabelle_scheduler(env): |
|
335 |
"""Scheduler for Mutabelle.""" |
|
336 |
return schedule.age_scheduler(env, 'Isabelle', mutabelle_confs) |
|
42040 | 337 |
|
338 |
# Judgement Day configurations |
|
339 |
||
42095 | 340 |
judgement_day_provers = ('e', 'spass', 'vampire', 'z3', 'cvc3', 'yices') |
42040 | 341 |
|
342 |
def judgement_day(base_path, theory, opts, env, case, paths, dep_paths, playground): |
|
343 |
"""Judgement Day regression suite""" |
|
344 |
||
345 |
isa = paths[0] |
|
346 |
dep_path = dep_paths[0] |
|
347 |
||
348 |
os.chdir(path.join(playground, '..', base_path)) # Mirabelle requires specific cwd |
|
349 |
prepare_isabelle_repository(isa, env.settings.contrib, dep_path) |
|
350 |
||
351 |
output = {} |
|
352 |
success_rates = {} |
|
353 |
some_success = False |
|
354 |
||
355 |
for atp in judgement_day_provers: |
|
356 |
||
357 |
log_dir = path.join(playground, 'mirabelle_log_' + atp) |
|
358 |
os.makedirs(log_dir) |
|
359 |
||
360 |
cmd = ('%s/bin/isabelle mirabelle -q -O %s sledgehammer[prover=%s,%s] %s.thy' |
|
361 |
% (isa, log_dir, atp, opts, theory)) |
|
362 |
||
363 |
os.system(cmd) |
|
364 |
output[atp] = util.readfile(path.join(log_dir, theory + '.log')) |
|
365 |
||
366 |
percentages = list(re.findall(r'Success rate: (\d+)%', output[atp])) |
|
367 |
if len(percentages) == 2: |
|
368 |
success_rates[atp] = { |
|
369 |
'sledgehammer': int(percentages[0]), |
|
370 |
'metis': int(percentages[1])} |
|
371 |
if success_rates[atp]['sledgehammer'] > 0: |
|
372 |
some_success = True |
|
373 |
else: |
|
374 |
success_rates[atp] = {} |
|
375 |
||
376 |
||
377 |
data = {'success_rates': success_rates} |
|
378 |
raw_attachments = dict((atp + "_output", output[atp]) for atp in judgement_day_provers) |
|
379 |
# FIXME: summary? |
|
380 |
return (some_success, '', data, raw_attachments, None) |
|
381 |
||
382 |
||
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
383 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
42040 | 384 |
def JD_NS(*args): |
385 |
"""Judgement Day regression suite NS""" |
|
386 |
return judgement_day('Isabelle/src/HOL/Auth', 'NS_Shared', 'prover_timeout=10', *args) |
|
387 |
||
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
388 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
42040 | 389 |
def JD_FTA(*args): |
390 |
"""Judgement Day regression suite FTA""" |
|
391 |
return judgement_day('Isabelle/src/HOL/Library', 'Fundamental_Theorem_Algebra', 'prover_timeout=10', *args) |
|
392 |
||
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
393 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
42040 | 394 |
def JD_Hoare(*args): |
395 |
"""Judgement Day regression suite Hoare""" |
|
42058
1eda69f0b9a8
moved some configurations to AFP, and fixed others
krauss
parents:
42040
diff
changeset
|
396 |
return judgement_day('Isabelle/src/HOL/IMPP', 'Hoare', 'prover_timeout=10', *args) |
42040 | 397 |
|
42948
e6990acab6ff
reverted 7fdd8d4908dc -- keeping images from Isabelle_makeall would be too expensive
krauss
parents:
42824
diff
changeset
|
398 |
@configuration(repos = [Isabelle], deps = [(HOL, [0])]) |
42040 | 399 |
def JD_SN(*args): |
400 |
"""Judgement Day regression suite SN""" |
|
42058
1eda69f0b9a8
moved some configurations to AFP, and fixed others
krauss
parents:
42040
diff
changeset
|
401 |
return judgement_day('Isabelle/src/HOL/Proofs/Lambda', 'StrongNorm', 'prover_timeout=10', *args) |
42040 | 402 |
|
42116
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
403 |
|
42192 | 404 |
JD_confs = 'JD_NS JD_FTA JD_Hoare JD_SN JD_Arrow JD_FFT JD_Jinja JD_QE JD_S2S'.split(' ') |
405 |
||
406 |
@scheduler() |
|
42197 | 407 |
def judgement_day_scheduler(env): |
42192 | 408 |
"""Scheduler for Judgement Day.""" |
409 |
return schedule.age_scheduler(env, 'Isabelle', JD_confs) |
|
410 |
||
411 |
||
42116
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
412 |
# SML/NJ |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
413 |
|
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
414 |
smlnj_settings = ''' |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
415 |
ML_SYSTEM=smlnj |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
416 |
ML_HOME="/home/smlnj/110.72/bin" |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
417 |
ML_OPTIONS="@SMLdebug=/dev/null @SMLalloc=256" |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
418 |
ML_PLATFORM=$(eval $("$ML_HOME/.arch-n-opsys" 2>/dev/null); echo "$HEAP_SUFFIX") |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
419 |
''' |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
420 |
|
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
421 |
@configuration(repos = [Isabelle], deps = []) |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
422 |
def SML_HOL(*args): |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
423 |
"""HOL image built with SML/NJ""" |
42140 | 424 |
return isabelle_make('src/HOL', *args, more_settings=smlnj_settings, target='HOL', keep_results=True) |
42116
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
425 |
|
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
426 |
@configuration(repos = [Isabelle], deps = []) |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
427 |
def SML_makeall(*args): |
b9ae421fbcc7
added configurations SML_HOL and SML_makeall (even though the latter is practically infeasible)
krauss
parents:
42115
diff
changeset
|
428 |
"""Makeall built with SML/NJ""" |
42138
e54a985daa61
added make target 'smlnj' to refer to what can/should be tested using smlnj -- allows the use of "isabelle makeall smlnj";
krauss
parents:
42121
diff
changeset
|
429 |
return isabelle_makeall(*args, more_settings=smlnj_settings, target='smlnj', make_options=('-j', '3')) |