# HG changeset patch # User krauss # Date 1311024950 -7200 # Node ID 182caf5cf0b600b7d6e5701499af9e8e1be78f74 # Parent f3e75541cb7833950defa401f0d7e31015983025 added experimental mira configuration for HOL Light importer diff -r f3e75541cb78 -r 182caf5cf0b6 Admin/mira.py --- a/Admin/mira.py Mon Jul 18 18:52:52 2011 +0200 +++ b/Admin/mira.py Mon Jul 18 23:35:50 2011 +0200 @@ -439,3 +439,36 @@ def SML_makeall(*args): """Makeall built with SML/NJ""" return isabelle_makeall(*args, more_settings=smlnj_settings, target='smlnj', make_options=('-j', '3')) + + + +# Importer + +@configuration(repos = ['Hollight'], deps = []) +def Hollight_proof_objects(env, case, paths, dep_paths, playground): + """Build proof object bundle from HOL Light""" + + hollight_home = paths[0] + os.chdir(os.path.join(hollight_home, 'Proofrecording', 'hol_light')) + + subprocess.check_call(['make']) + (return_code, _) = run_process.run_process( + '''echo -e '#use "hol.ml";;\n export_saved_proofs None;;' | ocaml''', + environment={'HOLPROOFEXPORTDIR': './proofs_extended', 'HOLPROOFOBJECTS': 'EXTENDED'}, + shell=True) + subprocess.check_call('tar -czf proofs_extended.tar.gz proofs_extended'.split(' ')) + subprocess.check_call(['mv', 'proofs_extended.tar.gz', playground]) + + return (return_code == 0, '', {}, {}, playground) + + +@configuration(repos = [Isabelle, 'Hollight'], deps = [(Hollight_proof_objects, [1])]) +def HOL_Generate_HOLLight(env, case, paths, dep_paths, playground): + """Generated theories by HOL Light import""" + + os.chdir(playground) + subprocess.check_call(['tar', '-xzf', path.join(dep_paths[0], 'proofs_extended.tar.gz')]) + proofs_dir = path.join(playground, 'proofs_extended') + + return isabelle_make('src/HOL', env, case, paths, dep_paths, playground, + more_settings=('HOL4PROOFS="%s"' % proofs_dir), target='HOL-Generate-HOLLight')