Update from HH
authorCezary Kaliszyk <cek@colo12-c703.uibk.ac.at>
Mon, 26 Aug 2013 15:43:31 +0000 (17:43 +0200)
committerCezary Kaliszyk <cek@colo12-c703.uibk.ac.at>
Mon, 26 Aug 2013 15:43:31 +0000 (17:43 +0200)
663 files changed:
development/thales/chaff/august9_2011_session.hl [new file with mode: 0644]
development/thales/chaff/external_arith.hl [new file with mode: 0644]
development/thales/chaff/general/flyshot.hl [new file with mode: 0644]
development/thales/chaff/general/flyshot2.hl [new file with mode: 0644]
development/thales/chaff/general/flyspeck_utility.hl [new file with mode: 0644]
development/thales/chaff/general/generate_definitions.ml [new file with mode: 0644]
development/thales/chaff/general/log.hl [new file with mode: 0644]
development/thales/chaff/general/snapshot.hl [new file with mode: 0644]
development/thales/chaff/general/template_def.ml [new file with mode: 0644]
development/thales/chaff/general/xx.hl [new file with mode: 0644]
development/thales/chaff/load_path.ml [new file with mode: 0644]
development/thales/chaff/meson_edit.hl [new file with mode: 0644]
development/thales/chaff/tactic.hl [new file with mode: 0644]
development/thales/chaff/tactics.hl [new file with mode: 0644]
development/thales/chaff/tame_constants.ml [new file with mode: 0644]
development/thales/chaff/tmp/determinants_patch.ml [new file with mode: 0644]
development/thales/chaff/tmp/vectors_patch.ml [new file with mode: 0644]
development/thales/examples/axiom_example.hl [new file with mode: 0644]
development/thales/examples/beta_pair_thm.hl [new file with mode: 0644]
development/thales/examples/lemma_negligible.hl [new file with mode: 0644]
development/thales/examples/sierpinski.hl [new file with mode: 0644]
development/thales/examples/workshop2010_beta_pair_thm.hl [new file with mode: 0644]
development/thales/examples/workshop2010_ky_lemma_negligible.hl [new file with mode: 0644]
development/thales/examples/workshop2010_quyen_example.hl [new file with mode: 0644]
development/thales/log/log_searches.hl [new file with mode: 0644]
development/thales/ocaml/leech.ml [new file with mode: 0755]
development/thales/ocaml/rank_boost.hl [new file with mode: 0644]
development/thales/ocaml/script.ml [new file with mode: 0644]
development/thales/ocaml/sphere.ml [new file with mode: 0644]
development/thales/session/cleanup.hl [new file with mode: 0644]
development/thales/session/experiment_.hl [new file with mode: 0644]
development/thales/session/localbuild.hl [new file with mode: 0644]
development/thales/session/scratch.hl [new file with mode: 0644]
development/thales/session/work_in_progress.hl [new file with mode: 0644]
emacs/print-types.ml [new file with mode: 0644]
formal_ineqs/arith/arith_cache.hl [new file with mode: 0644]
formal_ineqs/arith/arith_num.hl [new file with mode: 0644]
formal_ineqs/arith/eval_interval.hl [new file with mode: 0644]
formal_ineqs/arith/float.hl [new file with mode: 0644]
formal_ineqs/arith/float_atn.hl [new file with mode: 0644]
formal_ineqs/arith/float_theory.hl [new file with mode: 0644]
formal_ineqs/arith/interval_arith.hl [new file with mode: 0644]
formal_ineqs/arith/more_float.hl [new file with mode: 0644]
formal_ineqs/arith/nat.hl [new file with mode: 0644]
formal_ineqs/arith/num_exp_theory.hl [new file with mode: 0644]
formal_ineqs/arith_options.hl [new file with mode: 0644]
formal_ineqs/examples.hl [new file with mode: 0644]
formal_ineqs/examples_flyspeck.hl [new file with mode: 0644]
formal_ineqs/examples_poly.hl [new file with mode: 0644]
formal_ineqs/informal/informal_arith.hl [new file with mode: 0644]
formal_ineqs/informal/informal_eval_interval.hl [new file with mode: 0644]
formal_ineqs/informal/informal_m_taylor.hl [new file with mode: 0644]
formal_ineqs/informal/informal_m_verifier.hl [new file with mode: 0644]
formal_ineqs/jordan/parse_ext_override_interface.hl [new file with mode: 0644]
formal_ineqs/jordan/real_ext.hl [new file with mode: 0644]
formal_ineqs/jordan/refinement.hl [new file with mode: 0644]
formal_ineqs/jordan/taylor_atn.hl [new file with mode: 0644]
formal_ineqs/lib/ssrbool-compiled.hl [new file with mode: 0644]
formal_ineqs/lib/ssreflect/sections.hl [new file with mode: 0644]
formal_ineqs/lib/ssreflect/ssreflect.hl [new file with mode: 0644]
formal_ineqs/lib/ssrfun-compiled.hl [new file with mode: 0644]
formal_ineqs/lib/ssrnat-compiled.hl [new file with mode: 0644]
formal_ineqs/list/list_conversions.hl [new file with mode: 0644]
formal_ineqs/list/list_float.hl [new file with mode: 0644]
formal_ineqs/list/more_list.hl [new file with mode: 0644]
formal_ineqs/misc/misc.hl [new file with mode: 0644]
formal_ineqs/misc/vars.hl [new file with mode: 0644]
formal_ineqs/taylor/m_taylor.hl [new file with mode: 0644]
formal_ineqs/taylor/m_taylor_arith.hl [new file with mode: 0644]
formal_ineqs/taylor/m_taylor_arith2.hl [new file with mode: 0644]
formal_ineqs/taylor/theory/multivariate_taylor-compiled.hl [new file with mode: 0644]
formal_ineqs/taylor/theory/taylor_interval-compiled.hl [new file with mode: 0644]
formal_ineqs/verifier/interval_m/interval.ml [new file with mode: 0644]
formal_ineqs/verifier/interval_m/line_interval.ml [new file with mode: 0644]
formal_ineqs/verifier/interval_m/recurse.hl [new file with mode: 0644]
formal_ineqs/verifier/interval_m/recurse.ml [new file with mode: 0644]
formal_ineqs/verifier/interval_m/recurse0.ml [new file with mode: 0644]
formal_ineqs/verifier/interval_m/report.ml [new file with mode: 0644]
formal_ineqs/verifier/interval_m/taylor.ml [new file with mode: 0644]
formal_ineqs/verifier/interval_m/types.ml [new file with mode: 0644]
formal_ineqs/verifier/interval_m/univariate.ml [new file with mode: 0644]
formal_ineqs/verifier/interval_m/verifier.hl [new file with mode: 0644]
formal_ineqs/verifier/interval_m/verifier.ml [new file with mode: 0644]
formal_ineqs/verifier/m_verifier.hl [new file with mode: 0644]
formal_ineqs/verifier/m_verifier_build.hl [new file with mode: 0644]
formal_ineqs/verifier/m_verifier_main.hl [new file with mode: 0644]
formal_ineqs/verifier_options.hl [new file with mode: 0644]
formal_lp/glpk/build_certificates.hl [new file with mode: 0644]
formal_lp/glpk/build_main.hl [new file with mode: 0644]
formal_lp/glpk/ex1/bb1_out.hl [new file with mode: 0644]
formal_lp/glpk/ex2/bb2_1_out.hl [new file with mode: 0644]
formal_lp/glpk/ex2/bb2_2_out.hl [new file with mode: 0644]
formal_lp/glpk/ex2/bb2_3_out.hl [new file with mode: 0644]
formal_lp/glpk/ex2/bb2_4_out.hl [new file with mode: 0644]
formal_lp/glpk/ex2/bb2_5_out.hl [new file with mode: 0644]
formal_lp/glpk/feasible.hl [new file with mode: 0644]
formal_lp/glpk/lp_binary_certificate.hl [new file with mode: 0644]
formal_lp/glpk/onepass.hl [new file with mode: 0644]
formal_lp/glpk/test_hard.hl [new file with mode: 0644]
formal_lp/hypermap/arith_link.hl [new file with mode: 0644]
formal_lp/hypermap/computations/informal_computations.hl [new file with mode: 0644]
formal_lp/hypermap/computations/list_conversions2.hl [new file with mode: 0644]
formal_lp/hypermap/computations/list_hypermap_computations.hl [new file with mode: 0644]
formal_lp/hypermap/computations/more_theory-compiled.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_approx_ineqs.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_body_ineqs.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_body_ineqs_data.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_gen_ineqs.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_gen_theory-compiled.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_head_ineqs.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_ineqs.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_ineqs_defs.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_ineqs_proofs-compiled.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_ineqs_proofs2-compiled.hl [new file with mode: 0644]
formal_lp/hypermap/ineqs/lp_main_estimate-compiled.hl [new file with mode: 0644]
formal_lp/hypermap/main/lp_certificate.hl [new file with mode: 0644]
formal_lp/hypermap/main/prove_flyspeck_lp.hl [new file with mode: 0644]
formal_lp/hypermap/main/test6.hl [new file with mode: 0644]
formal_lp/hypermap/main/test_ex2_complete.hl [new file with mode: 0644]
formal_lp/hypermap/main/test_hard.hl [new file with mode: 0644]
formal_lp/hypermap/ssreflect/add_triangle-compiled.hl [new file with mode: 0644]
formal_lp/hypermap/ssreflect/list_hypermap-compiled.hl [new file with mode: 0644]
formal_lp/hypermap/ssreflect/list_hypermap_iso-compiled.hl [new file with mode: 0644]
formal_lp/hypermap/tests/test_all_lists.hl [new file with mode: 0644]
formal_lp/hypermap/verify_all.hl [new file with mode: 0644]
formal_lp/ineqs/constants_approx.hl [new file with mode: 0644]
formal_lp/ineqs/delta_ineq.hl [new file with mode: 0644]
formal_lp/lp_example/out_test.hl [new file with mode: 0644]
formal_lp/more_arith/arith_int.hl [new file with mode: 0644]
formal_lp/more_arith/lin_f.hl [new file with mode: 0644]
formal_lp/more_arith/prove_lp.hl [new file with mode: 0644]
formal_lp/old/arith/arith_array.hl [new file with mode: 0644]
formal_lp/old/arith/arith_cache.hl [new file with mode: 0644]
formal_lp/old/arith/arith_hash.hl [new file with mode: 0644]
formal_lp/old/arith/arith_hash2.hl [new file with mode: 0644]
formal_lp/old/arith/arith_hash_int.hl [new file with mode: 0644]
formal_lp/old/arith/arith_hash_rat.hl [new file with mode: 0644]
formal_lp/old/arith/arith_options.hl [new file with mode: 0644]
formal_lp/old/arith/float.hl [new file with mode: 0644]
formal_lp/old/arith/float_atn.hl [new file with mode: 0644]
formal_lp/old/arith/float_test.hl [new file with mode: 0644]
formal_lp/old/arith/float_theory.hl [new file with mode: 0644]
formal_lp/old/arith/informal/informal_arith.hl [new file with mode: 0644]
formal_lp/old/arith/informal/informal_eval_interval.hl [new file with mode: 0644]
formal_lp/old/arith/informal/informal_m_taylor.hl [new file with mode: 0644]
formal_lp/old/arith/informal/informal_m_verifier.hl [new file with mode: 0644]
formal_lp/old/arith/informal/tests1.hl [new file with mode: 0644]
formal_lp/old/arith/informal/tests2.hl [new file with mode: 0644]
formal_lp/old/arith/informal/tests3.hl [new file with mode: 0644]
formal_lp/old/arith/informal/tests_poly.hl [new file with mode: 0644]
formal_lp/old/arith/interval_arith.hl [new file with mode: 0644]
formal_lp/old/arith/misc.hl [new file with mode: 0644]
formal_lp/old/arith/nat.hl [new file with mode: 0644]
formal_lp/old/arith/num_exp_theory.hl [new file with mode: 0644]
formal_lp/old/arith/prove_lp.hl [new file with mode: 0644]
formal_lp/old/arith/tests/arith_test_data10.hl [new file with mode: 0644]
formal_lp/old/arith/tests/arith_test_data15.hl [new file with mode: 0644]
formal_lp/old/arith/tests/arith_test_data18.hl [new file with mode: 0644]
formal_lp/old/arith/tests/arith_test_data20.hl [new file with mode: 0644]
formal_lp/old/arith/tests/arith_test_data25.hl [new file with mode: 0644]
formal_lp/old/arith/tests/arith_test_data27.hl [new file with mode: 0644]
formal_lp/old/arith/tests/arith_test_data5.hl [new file with mode: 0644]
formal_lp/old/arith/tests/test_nat_arith.hl [new file with mode: 0644]
formal_lp/old/formal_interval/eval_interval.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_1d/interval.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_1d/line_interval.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_1d/recurse.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_1d/report.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_1d/taylor.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_1d/test1d.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_1d/types.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_1d/univariate.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_m/function_data.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_m/interval.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_m/line_interval.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_m/recurse.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_m/recurse0.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_m/report.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_m/taylor.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_m/types.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_m/univariate.hl [new file with mode: 0644]
formal_lp/old/formal_interval/interval_m/verifier.hl [new file with mode: 0644]
formal_lp/old/formal_interval/lin_approx.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_examples_poly.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_taylor.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_taylor_arith.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_taylor_arith2.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_taylor_old.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_test.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_tests.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_tests2.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_tests3.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_tests4.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_verifier.hl [new file with mode: 0644]
formal_lp/old/formal_interval/m_verifier0.hl [new file with mode: 0644]
formal_lp/old/formal_interval/more_float.hl [new file with mode: 0644]
formal_lp/old/formal_interval/second_approx.hl [new file with mode: 0644]
formal_lp/old/formal_interval/test.hl [new file with mode: 0644]
formal_lp/old/formal_interval/test_taylor_arith.hl [new file with mode: 0644]
formal_lp/old/formal_interval/tests_cmp.hl [new file with mode: 0644]
formal_lp/old/formal_interval/theory/multivariate_taylor.hl [new file with mode: 0644]
formal_lp/old/formal_interval/theory/taylor_interval.hl [new file with mode: 0644]
formal_lp/old/formal_interval/verifier.hl [new file with mode: 0644]
formal_lp/old/hypermap/constants_approx.hl [new file with mode: 0644]
formal_lp/old/hypermap/contravening_ineqs.hl [new file with mode: 0644]
formal_lp/old/hypermap/list_conversions.hl [new file with mode: 0644]
formal_lp/old/hypermap/list_hypermap.hl [new file with mode: 0644]
formal_lp/old/hypermap/list_hypermap_computations.hl [new file with mode: 0644]
formal_lp/old/hypermap/list_hypermap_defs.hl [new file with mode: 0644]
formal_lp/old/hypermap/list_hypermap_iso.hl [new file with mode: 0644]
formal_lp/old/hypermap/nobranching_lp.hl [new file with mode: 0644]
formal_lp/old/ineqs/contravening_ineqs.hl [new file with mode: 0644]
formal_lp/old/ineqs/list_conversions.hl [new file with mode: 0644]
formal_lp/old/ineqs/list_hypermap.hl [new file with mode: 0644]
formal_lp/old/ineqs/list_hypermap_computations.hl [new file with mode: 0644]
formal_lp/old/ineqs/list_hypermap_defs.hl [new file with mode: 0644]
formal_lp/old/ineqs/list_hypermap_iso.hl [new file with mode: 0644]
formal_lp/old/ineqs/list_hypermap_vars.hl [new file with mode: 0644]
formal_lp/old/ineqs/nobranching_lp.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/149438122187_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/156588677070_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/168941837467_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/176747399778_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/196565289721_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/202328731904_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/204898223616_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/206221606034_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/209986500083_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/234860659776_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/241242841715_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/241966209046_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/28820130324_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/62059307362_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/63917576180_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/72977109430_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/75655754509_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/86324340346_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/95170601659_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/97685954266_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/all.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests/all_tests.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/118343205068_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/118760185161_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/119040238600_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/122526068934_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/123040027899_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/125719999821_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/147671934133_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/156401568298_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/156615503428_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/158856256118_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/165950391005_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/168156828154_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/17272290668_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/195482381558_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/196021155893_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/206084941231_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/211626865969_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/219955817888_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/245859035526_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/25168582633_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/30500231120_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/4436579732_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/63626063287_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/69964410750_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/74394196986_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/91057093091_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/945145744_out.hl [new file with mode: 0644]
formal_lp/old/ineqs/tests2/all_tests.hl [new file with mode: 0644]
formal_lp/old/list/list_conversions.hl [new file with mode: 0644]
formal_lp/old/list/list_float.hl [new file with mode: 0644]
glpk/glpk_link.ml [new file with mode: 0644]
glpk/minorlp/OXLZLEZ.ml [new file with mode: 0644]
glpk/minorlp/tame_table.ml [new file with mode: 0644]
glpk/sphere.ml [new file with mode: 0644]
glpk/tame_archive/build_lp.hl [new file with mode: 0644]
glpk/tame_archive/hard_lp.ml [new file with mode: 0644]
glpk/tame_archive/lpproc.ml [new file with mode: 0644]
glpk/tame_archive/scaffolding.hl [new file with mode: 0644]
graph_generator/graph_control.hl [new file with mode: 0644]
jHOLLight/Examples/group_sylow-compiled.hl [new file with mode: 0644]
jHOLLight/Examples/seq-compiled.hl [new file with mode: 0644]
jHOLLight/Examples/ssrbool-compiled.hl [new file with mode: 0644]
jHOLLight/Examples/ssrfun-compiled.hl [new file with mode: 0644]
jHOLLight/Examples/ssrnat-compiled.hl [new file with mode: 0644]
jHOLLight/JHOL.app/Contents/Resources/Java/newprinter.ml [new file with mode: 0644]
jHOLLight/caml/raw_printer.hl [new file with mode: 0644]
jHOLLight/caml/sections.hl [new file with mode: 0644]
jHOLLight/caml/ssreflect.hl [new file with mode: 0644]
kepler_tex/tikz/tikz.ml [new file with mode: 0644]
legacy/general/database_more.ml [new file with mode: 0644]
legacy/general/deprecated_sphere.hl [new file with mode: 0644]
legacy/glpk/glpk/glpk_def.hl [new file with mode: 0644]
legacy/glpk/glpk/mkineq.ml [new file with mode: 0644]
legacy/glpk/glpk/tame_archive_hard_notes.hl [new file with mode: 0644]
legacy/inequalities/definitions_kepler.ml [new file with mode: 0644]
legacy/inequalities/definitions_keplerC.ml [new file with mode: 0644]
legacy/inequalities/dodec_ineq_names.ml [new file with mode: 0644]
legacy/inequalities/dodec_inequalities.ml [new file with mode: 0644]
legacy/inequalities/generate-ineq-syntax.ml [new file with mode: 0644]
legacy/inequalities/inequality_spec.ml [new file with mode: 0644]
legacy/inequalities/kep_deprecated.ml [new file with mode: 0644]
legacy/inequalities/kep_ineq_bis.ml [new file with mode: 0644]
legacy/inequalities/kep_inequalities.ml [new file with mode: 0644]
legacy/inequalities/kep_inequalities2.ml [new file with mode: 0644]
legacy/inequalities/kepler_ineq_names.ml [new file with mode: 0644]
legacy/inequalities/ocaml_to_sml.ml [new file with mode: 0644]
legacy/inequalities/sigmahat.hl [new file with mode: 0644]
legacy/inequalities/sphere.ml [new file with mode: 0644]
legacy/linear_program/LinProg.ml [new file with mode: 0644]
legacy/load_def_kepler.ml [new file with mode: 0644]
legacy/oldfan/Conforming2.hl [new file with mode: 0644]
legacy/oldfan/DHVFGBC.hl [new file with mode: 0755]
legacy/oldfan/DWWUTKW.hl [new file with mode: 0755]
legacy/oldfan/IBZWFFH.hl [new file with mode: 0755]
legacy/oldfan/JBDNJJB.hl [new file with mode: 0755]
legacy/oldfan/JGIYDLE.hl [new file with mode: 0755]
legacy/oldfan/JUTSTKG.hl [new file with mode: 0755]
legacy/oldfan/LEMMA.hl [new file with mode: 0755]
legacy/oldfan/RWXUYZZ.hl [new file with mode: 0755]
legacy/oldfan/TACTIC.hl [new file with mode: 0644]
legacy/oldfan/ULEKUUB.hl [new file with mode: 0755]
legacy/oldfan/VBTIKLP.hl [new file with mode: 0755]
legacy/oldfan/ch_fan/FAN_DEF.ml [new file with mode: 0644]
legacy/oldfan/ch_fan/fan_definition.hl [new file with mode: 0644]
legacy/oldfan/ch_fan/fan_definition2.hl [new file with mode: 0644]
legacy/oldfan/ch_fan/fan_summary.hl [new file with mode: 0644]
legacy/oldfan/definition_fan.hl [new file with mode: 0755]
legacy/oldfan/fan_concl.hl [new file with mode: 0644]
legacy/oldfan/fantopology.ml [new file with mode: 0644]
legacy/oldfan/fully_surrounded.hl [new file with mode: 0755]
legacy/oldfan/hypermap_of_fan.hl [new file with mode: 0755]
legacy/oldfan/introduction1.hl [new file with mode: 0755]
legacy/oldfan/leads_into.hl [new file with mode: 0755]
legacy/oldfan/node_fan.hl [new file with mode: 0755]
legacy/oldhypermap/ch_hypermap/hypermap_summary.hl [new file with mode: 0644]
legacy/oldleg/assembly.ml [new file with mode: 0644]
legacy/oldleg/collect_geom.ml [new file with mode: 0644]
legacy/oldleg/collect_geom_a.ml [new file with mode: 0644]
legacy/oldleg/collect_geom_error.ml [new file with mode: 0644]
legacy/oldleg/collect_geom_spec.ml [new file with mode: 0644]
legacy/oldleg/geomdetail.ml [new file with mode: 0644]
legacy/oldleg/geomdetail_08.ml [new file with mode: 0644]
legacy/oldleg/hull.ml [new file with mode: 0644]
legacy/oldleg/hull_error.ml [new file with mode: 0644]
legacy/oldlocal/PQCSXWG_old.hl [new file with mode: 0644]
legacy/oldlocal/XBJRPHC.hl [new file with mode: 0644]
legacy/oldlocal/ch_local/CKQOWSA.hl [new file with mode: 0644]
legacy/oldlocal/ch_local/cyclic_definition.hl [new file with mode: 0644]
legacy/oldlocal/ch_local/local_defs.hl [new file with mode: 0644]
legacy/oldlocal/ch_local/local_defs2.hl [new file with mode: 0644]
legacy/oldlocal/ch_local/local_fan.ml [new file with mode: 0644]
legacy/oldlocal/nguyenquangtruong270983/JBDNJJB.hl [new file with mode: 0644]
legacy/oldlocal/nguyenquangtruong270983/WRGCVDR_CIZMRRH.hl [new file with mode: 0644]
legacy/oldnonlinear/cutlemmas.hl [new file with mode: 0644]
legacy/oldnonlinear/deprecated_main_estimate_ineq.hl [new file with mode: 0644]
legacy/oldnonlinear/mdtau.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/break_quad_jul2013.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/experiments/oracle.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/experiments/test.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/experiments/test_may_2012.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/experiments/zumkeller_test.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/fejestoth12.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/ineq_cell23.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/main_estimate_pent_hex_cut_may_2013.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/main_ineq_calcs.ml [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/partials.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/temp_ineq.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/test_ineq.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/test_jun2012_ZTG_series.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/test_may2013_terminal_pent_hex_series.hl [new file with mode: 0644]
legacy/oldnonlinear/nonlinear/text_interface.hl [new file with mode: 0644]
legacy/oldnonlinear/post.hl [new file with mode: 0644]
legacy/oldnonlinear/removedef.hl [new file with mode: 0644]
legacy/oldpacking/BBDTRGC_def.hl [new file with mode: 0644]
legacy/oldpacking/DRUQUFE.hl [new file with mode: 0644]
legacy/oldpacking/IDBEZAL.hl [new file with mode: 0644]
legacy/oldpacking/JJGTQMN_def.hl [new file with mode: 0644]
legacy/oldpacking/JNRJQSM_def.hl [new file with mode: 0644]
legacy/oldpacking/KHEJKCI.hl [new file with mode: 0644]
legacy/oldpacking/NOPZSEH_def.hl [new file with mode: 0644]
legacy/oldpacking/PHZVPFY_def.hl [new file with mode: 0644]
legacy/oldpacking/RHWVGNP.hl [new file with mode: 0644]
legacy/oldpacking/TIWWFYQ.hl [new file with mode: 0644]
legacy/oldpacking/ch_packing/TSKAJXY.hl [new file with mode: 0644]
legacy/oldpacking/ch_packing/oxl_lemma.hl [new file with mode: 0644]
legacy/oldpacking/ky_packing/EMNWUUS.hl [new file with mode: 0644]
legacy/oldpacking/ky_packing/UPFZBZM.hl [new file with mode: 0644]
legacy/oldpacking/ky_packing/UPFZBZM_axioms.hl [new file with mode: 0644]
legacy/oldpacking/ky_packing/UPFZBZM_support_lemmas.hl [new file with mode: 0644]
legacy/oldpacking/ky_packing/UPFZBZM_working.hl [new file with mode: 0644]
legacy/oldpacking/ky_packing/marchal_cells.hl [new file with mode: 0644]
legacy/oldpacking/packing/development/Backup/GRUTOTI.hl [new file with mode: 0644]
legacy/oldpacking/packing/development/Backup/KIZHLTL.hl [new file with mode: 0644]
legacy/oldpacking/packing/development/Backup/RDWKARC.hl [new file with mode: 0644]
legacy/oldpacking/packing/development/Backup/UPFZBZM.hl [new file with mode: 0644]
legacy/oldpacking/packing/development/Backup/load_sequence.hl [new file with mode: 0644]
legacy/oldpacking/packing/development/Backup/marchal_cells_3.hl [new file with mode: 0644]
legacy/oldpacking/packing/development/Backup/sum_gammaX_lmfun_estimate.hl [new file with mode: 0644]
legacy/oldpacking/packing/development/REUHADY.hl [new file with mode: 0644]
legacy/oldpacking/packing/development/TSKAJXY.hl [new file with mode: 0644]
legacy/oldpacking/packing/development/marchal_cells_2.hl [new file with mode: 0755]
legacy/oldpacking/packing/development/sum_beta_bump.hl [new file with mode: 0755]
legacy/oldpacking/packing/development/working.hl [new file with mode: 0644]
legacy/oldtame/UBHDEUU.hl [new file with mode: 0644]
legacy/oldtame/dangtatdatusb/DLWCHEM.hl [new file with mode: 0644]
legacy/oldtame/dangtatdatusb/UBHDEUU.hl [new file with mode: 0644]
legacy/oldtame/pishort.hl [new file with mode: 0644]
legacy/oldtame/quarantine/SZIPOAS.hl [new file with mode: 0644]
legacy/oldtrig/run_file_euler.ml [new file with mode: 0755]
legacy/oldtrig/trig_old.ml [new file with mode: 0644]
legacy/oldvolume/ch_volume/vol2.hl [new file with mode: 0644]
legacy/oldvolume/ch_volume/volume.hl [new file with mode: 0644]
legacy/oldvolume/ch_volume/volume_temp.hl [new file with mode: 0644]
legacy/toplevel.ml [new file with mode: 0644]
make.ml [new file with mode: 0644]
port_interval/compose.hl [new file with mode: 0644]
port_interval/function_data.hl [new file with mode: 0644]
port_interval/interval.hl [new file with mode: 0644]
port_interval/line_interval.hl [new file with mode: 0644]
port_interval/recurse.hl [new file with mode: 0644]
port_interval/report.hl [new file with mode: 0644]
port_interval/taylor.hl [new file with mode: 0644]
port_interval/types.hl [new file with mode: 0644]
port_interval/univariate.hl [new file with mode: 0644]
projects_discrete_geom/bcc_lattice.hl [new file with mode: 0644]
projects_discrete_geom/bezdek_reid/bezdek_reid.hl [new file with mode: 0644]
projects_discrete_geom/fejestoth12/defs.hl [new file with mode: 0644]
projects_discrete_geom/fejestoth12/lipstick_ft.ml [new file with mode: 0644]
projects_discrete_geom/strong_dodec_conj/strongdodec_ineq.hl [new file with mode: 0644]
tame_archive/tame_archive.hl [new file with mode: 0644]
text_formalization/boot.hl [new file with mode: 0644]
text_formalization/boot.ml [new file with mode: 0644]
text_formalization/build.hl [new file with mode: 0644]
text_formalization/computational_build.hl [new file with mode: 0644]
text_formalization/fan/CFYXFTY.hl [new file with mode: 0644]
text_formalization/fan/Conforming.hl [new file with mode: 0755]
text_formalization/fan/GMLWKPK.hl [new file with mode: 0644]
text_formalization/fan/HypermapAndFan.hl [new file with mode: 0644]
text_formalization/fan/fan_defs.hl [new file with mode: 0644]
text_formalization/fan/fan_misc.hl [new file with mode: 0644]
text_formalization/fan/hypermap_iso-compiled.hl [new file with mode: 0644]
text_formalization/fan/introduction.hl [new file with mode: 0755]
text_formalization/fan/planarity.hl [new file with mode: 0755]
text_formalization/fan/polyhedron.hl [new file with mode: 0644]
text_formalization/fan/topology.hl [new file with mode: 0755]
text_formalization/general/debug.hl [new file with mode: 0644]
text_formalization/general/flyspeck_lib.hl [new file with mode: 0644]
text_formalization/general/hol_pervasives.hl [new file with mode: 0644]
text_formalization/general/lib.hl [new file with mode: 0644]
text_formalization/general/package_constant.hl [new file with mode: 0644]
text_formalization/general/parser_verbose.hl [new file with mode: 0644]
text_formalization/general/print_types.hl [new file with mode: 0644]
text_formalization/general/prove_by_refinement.hl [new file with mode: 0644]
text_formalization/general/sphere.hl [new file with mode: 0644]
text_formalization/general/state_manager.hl [new file with mode: 0644]
text_formalization/general/tactics.hl [new file with mode: 0644]
text_formalization/general/update_database_310.ml [new file with mode: 0644]
text_formalization/general/update_database_400.ml [new file with mode: 0644]
text_formalization/hypermap/bauer_nipkow.hl [new file with mode: 0644]
text_formalization/hypermap/hypermap.hl [new file with mode: 0644]
text_formalization/hypermap/summary.hl [new file with mode: 0644]
text_formalization/jordan/compute_pi.hl [new file with mode: 0644]
text_formalization/jordan/float.hl [new file with mode: 0644]
text_formalization/jordan/float_example.hl [new file with mode: 0644]
text_formalization/jordan/flyspeck_constants.hl [new file with mode: 0644]
text_formalization/jordan/goal_printer.hl [new file with mode: 0644]
text_formalization/jordan/hash_term.hl [new file with mode: 0644]
text_formalization/jordan/lib_ext.hl [new file with mode: 0644]
text_formalization/jordan/make.hl [new file with mode: 0644]
text_formalization/jordan/misc_defs_and_lemmas.hl [new file with mode: 0644]
text_formalization/jordan/num_ext_gcd.hl [new file with mode: 0644]
text_formalization/jordan/num_ext_nabs.hl [new file with mode: 0644]
text_formalization/jordan/parse_ext_override_interface.hl [new file with mode: 0644]
text_formalization/jordan/real_ext.hl [new file with mode: 0644]
text_formalization/jordan/real_ext_geom_series.hl [new file with mode: 0644]
text_formalization/jordan/refinement.hl [new file with mode: 0644]
text_formalization/jordan/tactics_jordan.hl [new file with mode: 0644]
text_formalization/jordan/taylor_atn.hl [new file with mode: 0644]
text_formalization/leg/AFF_SGN_TAC.hl [new file with mode: 0644]
text_formalization/leg/abc_of_quadratic_def.hl [new file with mode: 0644]
text_formalization/leg/affprops.hl [new file with mode: 0644]
text_formalization/leg/basics.hl [new file with mode: 0644]
text_formalization/leg/cayleyR_def.hl [new file with mode: 0644]
text_formalization/leg/collect_geom.hl [new file with mode: 0644]
text_formalization/leg/collect_geom2.hl [new file with mode: 0644]
text_formalization/leg/enclosed_def.hl [new file with mode: 0644]
text_formalization/leg/geomdetail.hl [new file with mode: 0644]
text_formalization/leg/muR_def.hl [new file with mode: 0644]
text_formalization/leg/quadratic_root_plus_def.hl [new file with mode: 0644]
text_formalization/local/ARDBZYE.hl [new file with mode: 0644]
text_formalization/local/AUEAHEH.hl [new file with mode: 0644]
text_formalization/local/AURSIPD.hl [new file with mode: 0644]
text_formalization/local/AXJRPNC.hl [new file with mode: 0644]
text_formalization/local/AYQJTMD.hl [new file with mode: 0755]
text_formalization/local/BKOSSGE.hl [new file with mode: 0644]
text_formalization/local/CNICGSF.hl [new file with mode: 0644]
text_formalization/local/CQAOQLR.hl [new file with mode: 0644]
text_formalization/local/CUXVZOZ.hl [new file with mode: 0644]
text_formalization/local/EYYPQDW.hl [new file with mode: 0755]
text_formalization/local/FEKTYIY.hl [new file with mode: 0644]
text_formalization/local/GBYCPXS.hl [new file with mode: 0755]
text_formalization/local/HDPLYGY.hl [new file with mode: 0755]
text_formalization/local/HIJQAHA.hl [new file with mode: 0644]
text_formalization/local/HXHYTIJ.hl [new file with mode: 0755]
text_formalization/local/IMJXPHR.hl [new file with mode: 0755]
text_formalization/local/IUNBUIG.hl [new file with mode: 0644]
text_formalization/local/JCYFMRP.hl [new file with mode: 0644]
text_formalization/local/JEJTVGB.hl [new file with mode: 0644]
text_formalization/local/JKQEWGV.hl [new file with mode: 0755]
text_formalization/local/JLXFDMJ.hl [new file with mode: 0644]
text_formalization/local/JOTSWIX.hl [new file with mode: 0644]
text_formalization/local/LDURDPN.hl [new file with mode: 0644]
text_formalization/local/LFJCIXP.hl [new file with mode: 0644]
text_formalization/local/LKGRQUI.hl [new file with mode: 0755]
text_formalization/local/LOCAL_LEMMAS.hl [new file with mode: 0644]
text_formalization/local/LVDUCXU.hl [new file with mode: 0644]
text_formalization/local/MIQMCSN.hl [new file with mode: 0644]
text_formalization/local/MTUWLUN.hl [new file with mode: 0755]
text_formalization/local/NKEZBFC.hl [new file with mode: 0644]
text_formalization/local/NUXCOEA.hl [new file with mode: 0644]
text_formalization/local/OCBICBY.hl [new file with mode: 0644]
text_formalization/local/ODXLSTCv2.hl [new file with mode: 0755]
text_formalization/local/OTMTOTJ.hl [new file with mode: 0644]
text_formalization/local/PCRTTID.hl [new file with mode: 0644]
text_formalization/local/PPBTYDQ.hl [new file with mode: 0644]
text_formalization/local/PQCSXWG.hl [new file with mode: 0644]
text_formalization/local/QKNVMLB.hl [new file with mode: 0755]
text_formalization/local/RNSYJXM-compiled.hl [new file with mode: 0644]
text_formalization/local/RRCWNSJ.hl [new file with mode: 0644]
text_formalization/local/SGTRNAF.hl [new file with mode: 0755]
text_formalization/local/TECOXBM.hl [new file with mode: 0644]
text_formalization/local/TFITSKC.hl [new file with mode: 0644]
text_formalization/local/UAGHHBM.hl [new file with mode: 0755]
text_formalization/local/UXCKFPE.hl [new file with mode: 0755]
text_formalization/local/VASYYAU.hl [new file with mode: 0644]
text_formalization/local/VPWSHTO.hl [new file with mode: 0644]
text_formalization/local/WJSCPRO.hl [new file with mode: 0755]
text_formalization/local/WKEIDFT.hl [new file with mode: 0644]
text_formalization/local/WRGCVDR_CIZMRRH.hl [new file with mode: 0644]
text_formalization/local/XIVPHKS.hl [new file with mode: 0644]
text_formalization/local/XWITCCN.hl [new file with mode: 0755]
text_formalization/local/YRTAFYH.hl [new file with mode: 0644]
text_formalization/local/YXIONXL.hl [new file with mode: 0755]
text_formalization/local/YXIONXL2.hl [new file with mode: 0755]
text_formalization/local/ZITHLQN.hl [new file with mode: 0644]
text_formalization/local/ZLZTHIC.hl [new file with mode: 0644]
text_formalization/local/appendix_main_estimate.hl [new file with mode: 0644]
text_formalization/local/deformation.hl [new file with mode: 0644]
text_formalization/local/dih2k.hl [new file with mode: 0755]
text_formalization/local/hexagons.hl [new file with mode: 0644]
text_formalization/local/local_lemmas1.hl [new file with mode: 0644]
text_formalization/local/localization.hl [new file with mode: 0644]
text_formalization/local/lp_details.hl [new file with mode: 0644]
text_formalization/local/lunar_deform.hl [new file with mode: 0644]
text_formalization/local/pent_hex.hl [new file with mode: 0644]
text_formalization/local/polar_fan.hl [new file with mode: 0644]
text_formalization/local/terminal.hl [new file with mode: 0644]
text_formalization/nonlinear/auto_lib.hl [new file with mode: 0644]
text_formalization/nonlinear/break_case_exec.hl [new file with mode: 0644]
text_formalization/nonlinear/break_case_log.hl [new file with mode: 0644]
text_formalization/nonlinear/calc_derivative.hl [new file with mode: 0644]
text_formalization/nonlinear/check_completeness.hl [new file with mode: 0644]
text_formalization/nonlinear/cleanDeriv.hl [new file with mode: 0644]
text_formalization/nonlinear/cleanDeriv_examples.hl [new file with mode: 0644]
text_formalization/nonlinear/compute_2158872499.hl [new file with mode: 0644]
text_formalization/nonlinear/formal_tests/hminus.hl [new file with mode: 0644]
text_formalization/nonlinear/formal_tests/ineq_ids.hl [new file with mode: 0644]
text_formalization/nonlinear/formal_tests/load.hl [new file with mode: 0644]
text_formalization/nonlinear/formal_tests/test1.hl [new file with mode: 0644]
text_formalization/nonlinear/formal_tests/test2.hl [new file with mode: 0644]
text_formalization/nonlinear/function_list.hl [new file with mode: 0644]
text_formalization/nonlinear/functional_equation.hl [new file with mode: 0644]
text_formalization/nonlinear/ineq.hl [new file with mode: 0644]
text_formalization/nonlinear/ineqdata3q1h.hl [new file with mode: 0644]
text_formalization/nonlinear/lemma.hl [new file with mode: 0644]
text_formalization/nonlinear/main_estimate_ineq.hl [new file with mode: 0644]
text_formalization/nonlinear/merge_ineq.hl [new file with mode: 0644]
text_formalization/nonlinear/mk_all_ineq.hl [new file with mode: 0644]
text_formalization/nonlinear/nonlin_def.hl [new file with mode: 0644]
text_formalization/nonlinear/optimize.hl [new file with mode: 0644]
text_formalization/nonlinear/parse_ineq.hl [new file with mode: 0644]
text_formalization/nonlinear/prep.hl [new file with mode: 0755]
text_formalization/nonlinear/scripts.hl [new file with mode: 0644]
text_formalization/nonlinear/sharp.hl [new file with mode: 0644]
text_formalization/nonlinear/types.hl [new file with mode: 0644]
text_formalization/nonlinear/vukhacky_tactics.hl [new file with mode: 0644]
text_formalization/packing/AJRIPQN.hl [new file with mode: 0755]
text_formalization/packing/DDZUPHJ.hl [new file with mode: 0755]
text_formalization/packing/EMNWUUS.hl [new file with mode: 0755]
text_formalization/packing/GRUTOTI.hl [new file with mode: 0755]
text_formalization/packing/HDTFNFZ.hl [new file with mode: 0755]
text_formalization/packing/KIZHLTL.hl [new file with mode: 0755]
text_formalization/packing/LEPJBDJ.hl [new file with mode: 0755]
text_formalization/packing/NJIUTIU.hl [new file with mode: 0755]
text_formalization/packing/OXLZLEZ.hl [new file with mode: 0644]
text_formalization/packing/OXL_def.hl [new file with mode: 0644]
text_formalization/packing/QZKSYKG.hl [new file with mode: 0755]
text_formalization/packing/QZYZMJC.hl [new file with mode: 0644]
text_formalization/packing/RDWKARC.hl [new file with mode: 0755]
text_formalization/packing/REUHADY.hl [new file with mode: 0644]
text_formalization/packing/RVFXZBU.hl [new file with mode: 0755]
text_formalization/packing/Rogers.hl [new file with mode: 0644]
text_formalization/packing/SLTSTLO.hl [new file with mode: 0755]
text_formalization/packing/TARJJUW.hl [new file with mode: 0644]
text_formalization/packing/TEZFFSK.hl [new file with mode: 0755]
text_formalization/packing/TSKAJXY.hl [new file with mode: 0644]
text_formalization/packing/TSKAJXY_034.hl [new file with mode: 0644]
text_formalization/packing/TSKAJXY_lemmas.hl [new file with mode: 0644]
text_formalization/packing/UPFZBZM.hl [new file with mode: 0755]
text_formalization/packing/UPFZBZM_support_lemmas.hl [new file with mode: 0755]
text_formalization/packing/URRPHBZ1.hl [new file with mode: 0644]
text_formalization/packing/URRPHBZ2.hl [new file with mode: 0755]
text_formalization/packing/URRPHBZ3.hl [new file with mode: 0755]
text_formalization/packing/YNHYJIT.hl [new file with mode: 0755]
text_formalization/packing/YSSKQOY.hl [new file with mode: 0644]
text_formalization/packing/bump.hl [new file with mode: 0644]
text_formalization/packing/counting_spheres.hl [new file with mode: 0644]
text_formalization/packing/leaf_cell.hl [new file with mode: 0644]
text_formalization/packing/marchal_cells.hl [new file with mode: 0755]
text_formalization/packing/marchal_cells_2_new.hl [new file with mode: 0755]
text_formalization/packing/marchal_cells_3.hl [new file with mode: 0755]
text_formalization/packing/oxl_2012.hl [new file with mode: 0644]
text_formalization/packing/pack1.hl [new file with mode: 0644]
text_formalization/packing/pack2.hl [new file with mode: 0644]
text_formalization/packing/pack3.hl [new file with mode: 0644]
text_formalization/packing/pack_concl.hl [new file with mode: 0644]
text_formalization/packing/pack_defs.hl [new file with mode: 0644]
text_formalization/packing/sum_gammaX_lmfun_estimate.hl [new file with mode: 0755]
text_formalization/strictbuild.hl [new file with mode: 0644]
text_formalization/tame/ArcProperties.hl [new file with mode: 0644]
text_formalization/tame/CDTETAT.hl [new file with mode: 0644]
text_formalization/tame/CKQOWSA.hl [new file with mode: 0644]
text_formalization/tame/CKQOWSA_3.hl [new file with mode: 0644]
text_formalization/tame/CKQOWSA_4.hl [new file with mode: 0644]
text_formalization/tame/CRTTXAT.hl [new file with mode: 0644]
text_formalization/tame/FATUGPD.hl [new file with mode: 0755]
text_formalization/tame/HRXEFDM.hl [new file with mode: 0644]
text_formalization/tame/Inequalities.hl [new file with mode: 0644]
text_formalization/tame/JGTDEBU.hl [new file with mode: 0644]
text_formalization/tame/TameGeneral.hl [new file with mode: 0644]
text_formalization/tame/dont_repeat_yourself.hl [new file with mode: 0644]
text_formalization/tame/ssreflect/FNJLBXS-compiled.hl [new file with mode: 0644]
text_formalization/tame/ssreflect/KCBLRQC-compiled.hl [new file with mode: 0644]
text_formalization/tame/ssreflect/MQMSMAB-compiled.hl [new file with mode: 0644]
text_formalization/tame/ssreflect/seq2-compiled.hl [new file with mode: 0644]
text_formalization/tame/ssreflect/sort-compiled.hl [new file with mode: 0644]
text_formalization/tame/ssreflect/tame_lemmas-compiled.hl [new file with mode: 0644]
text_formalization/tame/tame_concl.hl [new file with mode: 0644]
text_formalization/tame/tame_defs.hl [new file with mode: 0644]
text_formalization/tame/tame_opposite.hl [new file with mode: 0644]
text_formalization/trigonometry/HVIHVEC.hl [new file with mode: 0644]
text_formalization/trigonometry/delta_x.hl [new file with mode: 0755]
text_formalization/trigonometry/euler_complement.hl [new file with mode: 0755]
text_formalization/trigonometry/euler_main_theorem.hl [new file with mode: 0755]
text_formalization/trigonometry/euler_multivariate.hl [new file with mode: 0755]
text_formalization/trigonometry/trig1.hl [new file with mode: 0644]
text_formalization/trigonometry/trig2.hl [new file with mode: 0644]
text_formalization/trigonometry/trigonometry.hl [new file with mode: 0644]
text_formalization/usr/thales/hales_tactic.hl [new file with mode: 0644]
text_formalization/usr/thales/init_search.hl [new file with mode: 0644]
text_formalization/usr/thales/searching.hl [new file with mode: 0644]
text_formalization/volume/vol1.hl [new file with mode: 0644]

diff --git a/development/thales/chaff/august9_2011_session.hl b/development/thales/chaff/august9_2011_session.hl
new file mode 100644 (file)
index 0000000..e730323
--- /dev/null
@@ -0,0 +1,105 @@
+(* Code from Carnegie Library Session with 
+   Tom Hales and Nick Volker, August 9, 2011
+
+*)
+
+
+Trigonometry1.ATN2_BREAKDOWN;;
+
+(* modify Calc_derivative module to remove signature, 
+   reload, then open *)
+
+open Calc_derivative;;
+
+
+let test_aug9_2011 = prove_by_refinement(
+  `!x. (x > &0) ==> (?eps. abs(x - eps) > &0)`,
+  (* {{{ proof *)
+  [
+  REPEAT STRIP_TAC;
+EXISTS_TAC `x / &2`;
+ASM_REAL_ARITH_TAC
+  ]);;
+  (* }}} *)
+
+let derived_imp_pos_open = prove_by_refinement(
+  `!p f f' x s.  p /\ derived_form p f f' x s /\ &0 < f x ==>
+     (?d. &0 < d /\ (!x'. x' IN s /\ abs (x' - x) < d ==> &0 < f x'))`,
+  (* {{{ proof *)
+  [
+REWRITE_TAC[Calc_derivative.derived_form];
+REWRITE_TAC[TAUT `(a /\ (a ==> b) /\ c) <=> (a /\ b /\ c)`];
+REPEAT STRIP_TAC;
+FIRST_X_ASSUM (MP_TAC o (  MATCH_MP HAS_REAL_DERIVATIVE_IMP_CONTINUOUS_WITHINREAL ));
+REWRITE_TAC[real_continuous_withinreal];
+DISCH_THEN (MP_TAC o (SPEC `(f:real->real) x`));
+ASM_REWRITE_TAC[];
+STRIP_TAC;
+EXISTS_TAC `d:real`;
+ASM_REWRITE_TAC[];
+REPEAT STRIP_TAC;
+FIRST_X_ASSUM (MP_TAC o (SPEC `x':real`));
+ASM_REWRITE_TAC[];
+ASM_REAL_ARITH_TAC;
+  ]);;
+  (* }}} *)
+
+
+let derived_form_chain_simple = prove_by_refinement(
+  `!x s g g' f f' p p'.
+         derived_form p g g' (f x) (:real) /\
+         derived_form p' f f' x s
+         ==> derived_form (p /\ p') (\x. g (f x)) (f' * g') x s`,
+  (* {{{ proof *)
+  [
+  MESON_TAC[derived_form_chain]
+  ]);;
+  (* }}} *)
+
+let atn2_lemma = prove_by_refinement(
+  `!x pf f f' pg g g' s.  (&0 < f x) /\ derived_form pf f f' x s /\ derived_form pg g g' x s ==> derived_form (T /\ (pg /\ pf)) (\x. atn( g x / f x)) ((g' * f x - g x * f')/(f x pow 2) *inv (&1 + (g x / f x) pow 2)) x s`,
+  (* {{{ proof *)
+  [
+REPEAT STRIP_TAC;
+MATCH_MP_TAC derived_form_chain_simple;
+REWRITE_TAC[derived_form_atn];
+MP_TAC (REAL_ARITH `&0 < (f:real->real) x ==> ~(f x = &0)`);
+SUBGOAL_THEN `derived_form (pg /\ pf /\ ~(f x = &0)) (\x. g x / f x)      ((g' * f x - g x * f') / f x pow 2)      x      s` MP_TAC;
+MATCH_MP_TAC derived_form_div;
+ASM_REWRITE_TAC[];
+ASM_REWRITE_TAC[derived_form];
+REPEAT STRIP_TAC;
+FIRST_X_ASSUM MATCH_MP_TAC;
+ASM_REWRITE_TAC[]
+  ]);;
+  (* }}} *)
+
+
+(* UNFINISHED
+let atn2_derived_form_pos = prove_by_refinement(
+  `!x pf f f' pg g g' s.  (&0 < f x) /\ derived_form pf f f' x s /\ derived_form pg g g' x s ==> derived_form (pf /\ pg) (\x. atn( g x / f x)) ((g' * f x - g x * f')*inv (f x pow 2 + g x pow 2)) x s`,
+  (* {{{ proof *)
+  [
+REPEAT STRIP_TAC
+UNDISCH_TAC `pf ==> (f has_real_derivative f') (atreal x within s)`
+UNDISCH_TAC `pg ==> (g has_real_derivative g') (atreal x within s)`
+ASM_REWRITE_TAC[]
+REPEAT STRIP_TAC
+  ]);;
+  (* }}} *)
+
+*)
+
+(* UNFINISHED
+let atn2_atn_open = prove_by_refinement(
+  `!p f f' g x s.  p /\ derived_form p f f' x s /\ (&0 < f x)==>
+    (?d. &0 < d /\ (!x'. x' IN s /\ abs (x' - x) < d ==>
+        atn2 (f x', g x') = atn(g x' / f x')))`,
+  (* {{{ proof *)
+  [
+REPEAT GEN_TAC;
+    DISCH_THEN (MP_TAC o (MATCH_MP derived_imp_pos_open))
+  ]);;
+  (* }}} *)
+*)
+
diff --git a/development/thales/chaff/external_arith.hl b/development/thales/chaff/external_arith.hl
new file mode 100644 (file)
index 0000000..d0d71db
--- /dev/null
@@ -0,0 +1,119 @@
+(* ========================================================================== *)
+(* FLYSPECK - BOOK FORMALIZATION                                              *)
+(*                                                                            *)
+(* External Rational Number Operations                                                    *)
+(* Author: Thomas C. Hales                                                    *)
+(* Date: 2010-09-17                                                           *)
+(* ========================================================================== *)
+
+
+type mixed_term = 
+  | Ocaml_num of num
+  | Ocaml_real of num
+  | Hol_light of bool*term;; (* true if changed *)
+
+(*
+type num =
+|      Int of int
+|      Big_int of Big_int.big_int
+|      Ratio of Ratio.ratio ///;;
+
+let internalize_bool = function
+  |  true -> `T`
+  |  false -> `F`;;
+*)
+
+let realize = 
+  let amp = `real_of_num` in
+   fun x -> mk_comb (amp,x);;
+
+let real_of_rat  = 
+  let real_div = `real_div` in
+  let quot n d = mk_binop real_div (realize n) (realize d) in
+    fun x -> 
+      let n = mk_numeral(Big_int (Ratio.numerator_ratio x)) in
+      let d = mk_numeral(Big_int (Ratio.denominator_ratio x)) in 
+       quot n d;;
+
+let term_of_mixed = 
+    function
+  | Ocaml_real a -> 
+      (match a with
+       | Big_int _ -> realize(mk_numeral a)
+        | Int x -> realize (mk_small_numeral x)
+       | Ratio x -> real_of_rat x)
+  | Ocaml_num a -> 
+      (match a with
+       | Big_int _ ->(mk_numeral a)
+        | Int x ->  (mk_small_numeral x)
+       | Ratio _ -> failwith "unnatural quotient")
+  | Hol_light (changed,t) -> t;;
+
+let dest_binop_from oplist t = 
+  let (h,y)= dest_comb t in
+  let (op,x) = dest_comb h in
+    if (mem op oplist) then (op,x,y) else failwith "op not found";;
+
+let zero  = Int 0;;
+
+let one = Int 1;;
+
+let num_trunc_minus x y =  if ( y >/ x) then zero else x -/ y;;
+
+let rat_div x y = if (y =/ zero) then zero else (x // y);;
+
+let rat_inv x = if (x =/ zero) then zero else (one // x);;
+
+let mk_cty ty = map (fun (a,b)-> (mk_mconst(a,ty),b));;
+
+(*
+let real_rels = mk_cty `:real->real->bool` 
+ ["real_lt";"real_le";"=";"real_ge";"real_gt"];;
+
+let num_rels = mk_cty `:num->num->bool`
+  ["<=";"<";"=";">=";">="];;
+*)
+
+let real_binop = mk_cty `:real->real->real`
+ [("real_add",( +/ ));("real_sub", ( -/ ));("real_mul", ( */ ));("real_div",rat_div)];;
+
+let num_binop = mk_cty `:num->num->num`
+ [("+",( +/ ));("-",num_trunc_minus);("*", ( */ ))];;
+
+let dec_op = mk_cty `:num->num->real`
+ [("DECIMAL",( // ))];;
+
+let numeral_op = mk_cty `:num->real` ["real_of_num",I];;
+
+let real_unary = mk_cty `:real->real` [("real_neg",minus_num);("real_inv",rat_inv)];;
+
+(*
+let lift (a,b) x  = function;;
+*)
+
+let rec mixed_of_term arith = function
+  | Var _ as u -> Hol_light (false,u)
+  | Const _ as u -> Hol_light (false,u)
+  | Abs(x,t) as u -> let t' = mixed_of_term false t in
+      (match t' with
+        | Hol_light (false,_) -> Hol_light (false,u)
+        | _ -> Hol_light (true,mk_abs(x, term_of_mixed t')))
+(*
+  | Const (h,y) as u -> Hol_lightu;;
+      if (is_const h) 
+*)
+;;
+
+type_of `DECIMAL`;;
+type_of `3`;;
+let mixedalize t = t;;
+
+mk_numeral;;    
+Int 3;;
+
+Int 3;;
+
+let v = Int 3 // Int 4;;
+let rec sqx n v = if (n = 0) then Int 1 else if (n=1) then v else (sqx (n-1) v)*/ (sqx (n-1) v);;
+
+let vv = sqx 10 v;;
diff --git a/development/thales/chaff/general/flyshot.hl b/development/thales/chaff/general/flyshot.hl
new file mode 100644 (file)
index 0000000..6a9c6df
--- /dev/null
@@ -0,0 +1,744 @@
+(* Extension of snapshot.hl.  This has to be read in after the flyspeck build,
+   because it contains new types defined by the build *)
+
+module Snapshot_flyspeck_build_2010_02_12 : Snapshot_type = struct
+
+  let hol_version =  "2.20++";;
+  let hol_snapshot = "7_31_09";;
+  let svn_version = 1524;; 
+
+  let the_interface = Snapshot_v220_7_31_2009.the_interface;;
+  let the_filetable =   [("general/flyspeck_utility.hl", 832);
+   ("general/update_database_310.ml", 832); ("hypermap/hypermap.hl", 832);
+   ("volume/vol1.hl", 737); ("trigonometry/trigonometry.hl", 719);
+   ("general/flyspeck_utility.hl", 717); ("trigonometry/trig2.hl", 717);
+   ("trigonometry/trig1.hl", 708); ("nonlinear/ineqdata3q1h.hl", 707);
+   ("nonlinear/ineq.hl", 707); ("leg/enclosed_def.hl", 707);
+   ("leg/quadratic_root_plus_def.hl", 706);
+   ("leg/abc_of_quadratic_def.hl", 705); ("leg/muR_def.hl", 704);
+   ("leg/collect_geom.hl", 703); ("leg/cayleyR_def.hl", 678);
+   ("leg/affprops.hl", 677); ("leg/AFF_SGN_TAC.hl", 677);
+   ("leg/geomdetail.hl", 677); ("pervasives", 673)];;
+
+  let the_constants = 
+  [ 
+   ("map3", `:real^3->real^3->real^3`);
+   ("canon", `:(A)hypermap->((A)loop->bool)->((A->bool)->bool)->bool`);
+   ("is_flag", `:(A)hypermap->((A->bool)->bool)->bool`);
+   ("is_gen_flag", `:(A)hypermap->(A->bool)->((A->bool)->bool)->bool`);
+   ("edge_nondegenerate", `:(A)hypermap->bool`);
+   ("face_collection", `:(A)hypermap->(A)loop->bool`);
+   ("face_loop", `:(A)hypermap->A->(A)loop`);
+   ("res", `:(A->A)->(A->bool)->A->A`);
+   ("team", `:(A)hypermap->(A)loop->(A->bool)->bool`);
+   ("iso", `:(A)hypermap->(B)hypermap->bool`);
+   ("quotient", `:(A)hypermap->((A)loop->bool)->(A->bool)hypermap`);
+   ("nmap", `:(A)hypermap->((A)loop->bool)->(A->bool)->A->bool`);
+   ("fmap", `:(A)hypermap->((A)loop->bool)->(A->bool)->A->bool`);
+   ("tail", `:(A)hypermap->((A)loop->bool)->A->A`);
+   ("head", `:(A)hypermap->((A)loop->bool)->A->A`);
+   ("choice", `:(A)hypermap->((A)loop->bool)->A->A->bool`);
+   ("support_darts", `:((A)loop->bool)->A->bool`);
+   ("quotient_darts", `:(A)hypermap->((A)loop->bool)->(A->bool)->bool`);
+   ("is_normal", `:(A)hypermap->((A)loop->bool)->bool`);
+   ("atom", `:(A)hypermap->(A)loop->A->A->bool`);
+   ("is_node_going", `:(A)hypermap->(A)loop->A->A->bool`);
+   ("in_path", `:(num->A)->num->A->bool`);
+   ("set_dart_of", `:(num->A)->num->A->bool`);
+   ("contour_of", `:(A)loop->A->num->A`);
+   ("is_loop", `:(A)hypermap->(A)loop->bool`); ("top", `:(A)loop->num`);
+   ("size", `:(A)loop->num`); ("inside", `:A->(A)loop->bool`);
+   ("back", `:(A)loop->A->A`); ("next", `:(A)loop->A->A`);
+   ("dart_of", `:(A)loop->A->bool`);
+   ("tuple_loop", `:(A)loop->(A->bool)#(A->A)`);
+   ("loop", `:(A->bool)#(A->A)->(A)loop`);
+   ("shift_path", `:(num->A)->num->num->A`);
+   ("is_Moebius_contour", `:(A)hypermap->(num->A)->num->bool`);
+   ("is_splitting_component", `:(A)hypermap->A->bool`);
+   ("planar_ind", `:(A)hypermap->real`);
+   ("is_face_split", `:(A)hypermap->A->bool`);
+   ("is_node_split", `:(A)hypermap->A->bool`);
+   ("is_edge_split", `:(A)hypermap->A->bool`);
+   ("is_face_merge", `:(A)hypermap->A->bool`);
+   ("is_node_merge", `:(A)hypermap->A->bool`);
+   ("is_edge_merge", `:(A)hypermap->A->bool`);
+   ("inj_orbit", `:(A->A)->A->num->bool`);
+   ("double_face_walkup", `:(A)hypermap->A->A->(A)hypermap`);
+   ("double_node_walkup", `:(A)hypermap->A->A->(A)hypermap`);
+   ("double_edge_walkup", `:(A)hypermap->A->A->(A)hypermap`);
+   ("face_walkup", `:(A)hypermap->A->(A)hypermap`);
+   ("node_walkup", `:(A)hypermap->A->(A)hypermap`);
+   ("edge_walkup", `:(A)hypermap->A->(A)hypermap`);
+   ("shift", `:(A)hypermap->(A)hypermap`);
+   ("is_face_degenerate", `:(A)hypermap->A->bool`);
+   ("is_node_degenerate", `:(A)hypermap->A->bool`);
+   ("is_edge_degenerate", `:(A)hypermap->A->bool`);
+   ("isolated_dart", `:(A)hypermap->A->bool`);
+   ("is_inj_contour", `:(A)hypermap->(num->A)->num->bool`);
+   ("face_contour", `:(A)hypermap->A->num->A`);
+   ("node_contour", `:(A)hypermap->A->num->A`);
+   ("is_contour", `:(A)hypermap->(num->A)->num->bool`);
+   ("one_step_contour", `:(A)hypermap->A->A->bool`);
+   ("face_path", `:(A)hypermap->A->num->A`);
+   ("node_path", `:(A)hypermap->A->num->A`);
+   ("edge_path", `:(A)hypermap->A->num->A`);
+   ("connected_hypermap", `:(A)hypermap->bool`);
+   ("dart_nondegenerate", `:(A)hypermap->A->bool`);
+   ("dart_degenerate", `:(A)hypermap->A->bool`);
+   ("simple_hypermap", `:(A)hypermap->bool`);
+   ("planar_hypermap", `:(A)hypermap->bool`);
+   ("plain_hypermap", `:(A)hypermap->bool`);
+   ("number_of_components", `:(A)hypermap->num`);
+   ("number_of_faces", `:(A)hypermap->num`);
+   ("number_of_nodes", `:(A)hypermap->num`);
+   ("number_of_edges", `:(A)hypermap->num`);
+   ("set_of_components", `:(A)hypermap->(A->bool)->bool`);
+   ("set_part_components", `:(A)hypermap->(A->bool)->(A->bool)->bool`);
+   ("set_components", `:(A)hypermap->(A->bool)->(A->bool)->bool`);
+   ("face_set", `:(A)hypermap->(A->bool)->bool`);
+   ("node_set", `:(A)hypermap->(A->bool)->bool`);
+   ("edge_set", `:(A)hypermap->(A->bool)->bool`);
+   ("number_of_orbits", `:(A->bool)->(A->A)->num`);
+   ("set_of_orbits", `:(A->bool)->(A->A)->(A->bool)->bool`);
+   ("comb_component", `:(A)hypermap->A->A->bool`);
+   ("is_in_component", `:(A)hypermap->A->A->bool`);
+   ("is_path", `:(A)hypermap->(num->A)->num->bool`);
+   ("go_one_step", `:(A)hypermap->A->A->bool`);
+   ("face", `:(A)hypermap->A->A->bool`);
+   ("node", `:(A)hypermap->A->A->bool`);
+   ("edge", `:(A)hypermap->A->A->bool`); ("face_map", `:(A)hypermap->A->A`);
+   ("node_map", `:(A)hypermap->A->A`); ("edge_map", `:(A)hypermap->A->A`);
+   ("dart", `:(A)hypermap->A->bool`);
+   ("tuple_hypermap", `:(A)hypermap->(A->bool)#(A->A)#(A->A)#(A->A)`);
+   ("hypermap", `:(A->bool)#(A->A)#(A->A)#(A->A)->(A)hypermap`);
+   ("orbit_map", `:(A->A)->A->A->bool`); ("POWER", `:(A->A)->num->A->A`);
+   ("integer_point", `:(real^3->bool)->real^3->bool`);
+   ("map1", `:real^3->real^3->bool`);
+   ("close_hinhcau", `:real^3->real->real^3->bool`);
+   ("set_of_ccube", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("ccube", `:real^3->real^3->bool`);
+   ("vector_to_pair", `:real^3->real#real#real`);
+   ("int_interval", `:real->real->real->bool`);
+   ("map0", `:real^3->real^3->bool`);
+   ("union_of_int_cube", `:real^3->real->real^3->bool`);
+   ("int_ball", `:real^3->real->real^3->bool`);
+   ("union_of_cube", `:real^3->real->real^3->bool`);
+   ("set_of_cube", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("hinhcau", `:real^3->real->real^3->bool`);
+   ("cube", `:real^3->real^3->bool`);
+   ("sol", `:(real^3->bool)->real^3->real`);
+   ("volume_prop_fix", `:((real^3->bool)->real)->bool`);
+   ("eventually_radial_norm", `:real^A->(real^A->bool)->bool`);
+   ("radial_norm", `:real->real^A->(real^A->bool)->bool`);
+   ("parallel", `:real^N->real^N->bool`); ("unknown", `:bool`);
+   ("arg_diff", `:real^2->real^2->real`); ("pl_angle", `:real^2->real`);
+   ("polar_cycle_on", `:(real^2->real^2)->(real^2->bool)->bool`);
+   ("polar_le", `:real^2->real^2->bool`);
+   ("polar_lt", `:real^2->real^2->bool`); ("tri_itv", `:real->bool`);
+   ("real_itv", `:real->real->real->bool`);
+   ("sinV", `:real^A->real^A->real`); ("cosV", `:real^A->real^A->real`);
+   ("atan2_temp", `:real#real->real`);
+   ("enclosed",
+    `:real->real->real->real->real->real->real->real->real->real`);
+   ("quadratic_root_plus", `:real#real#real->real`);
+   ("abc_of_quadratic", `:(real->real)->real#real#real`);
+   ("muR",
+    `:real->real->real->real->real->real->real->real->real->real->real`);
+   ("muy_v", `:real^N->real^N->real^N->real^N->real^N->real->real`);
+   ("muy_delta", `:real->real->real->real->real->real->real`);
+   ("det_vec3", `:real^3->real^3->real^3->real`);
+   ("condA",
+    `:real^3->real^3->real^3->real^3->real->real->real->real->real->A->bool`);
+   ("coplanar_alt", `:(real^A->bool)->bool`);
+   ("cayleytr",
+    `:real->real->real->real->real->real->real->real->real->real->real`);
+   ("delta_x14", `:real->real->real->real->real->real->real`);
+   ("delta_x13", `:real->real->real->real->real->real->real`);
+   ("delta_x12", `:real->real->real->real->real->real->real`);
+   ("coef3", `:real^N->real^N->real^N->real^N->real`);
+   ("coef2", `:real^N->real^N->real^N->real^N->real`);
+   ("coef1", `:real^N->real^N->real^N->real^N->real`);
+   ("c_coef", `:real->real->real->real->real->real`);
+   ("b_coef", `:real->real->real->real->real->real`);
+   ("cm3_ups_x", `:real^3->real^3->real^3->real`);
+   ("plane_3p", `:real^3->real^3->real^3->real^3->bool`);
+   ("delta_x34", `:real->real->real->real->real->real->real`);
+   ("plane_norm", `:(real^A->bool)->bool`);
+   ("ups_x_pow2", `:real->real->real->real`);
+   ("max_real3", `:real->real->real->real`);
+   ("max_real", `:real->real->real`);
+   ("eta_v", `:real^N->real^N->real^N->real`);
+   ("delta", `:real->real->real->real->real->real->real`);
+   ("chi", `:real->real->real->real->real->real->real`);
+   ("rho_ij", `:real->real->real->real->real->real->real`);
+   ("cayleyR",
+    `:real->real->real->real->real->real->real->real->real->real->real`);
+   ("min_dist", `:real^3->(real^3->bool)->bool`);
+   ("e_plane", `:real^N->real^N->real^N->bool`);
+   ("near2t0", `:real^A->(real^A->bool)->real^A->bool`);
+   ("near", `:real^N->real->(real^N->bool)->real^N->bool`);
+   ("VC_INFI", `:(real^3->bool)->real^3->bool`);
+   ("VC", `:real^3->(real^3->bool)->real^3->bool`);
+   ("lambda_y", `:real^3->(real^3->bool)->real^3->bool`);
+   ("lambda_x", `:real^3->(real^3->bool)->real^3->bool`);
+   ("VC_INFI_trg", `:(real^3->bool)->real^3->bool`);
+   ("VC_trg", `:real^3->(real^3->bool)->real^3->bool`);
+   ("unobstructed", `:real^3->real^3->(real^3->bool)->bool`);
+   ("obstruct", `:real^3->real^3->(real^3->bool)->bool`);
+   ("conv", `:(real^A->bool)->real^A->bool`);
+   ("obstructed", `:real^3->real^3->(real^3->bool)->bool`);
+   ("barrier", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("Q_SYS", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("anchor_points", `:real^3->real^3->(real^3->bool)->real^3->bool`);
+   ("anchor", `:real^3->real^3->real^3->(real^3->bool)->bool`);
+   ("isolated_pai", `:(real^3->bool)->(real^3->bool)->(real^3->bool)->bool`);
+   ("isolated_qua", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("interior_pos",
+    `:real^3->real^3->real^3->real^3->real^3->(real^3->bool)->bool`);
+   ("conflicting_dia",
+    `:real^3->real^3->real^3->real^3->real^3->(real^3->bool)->bool`);
+   ("adjacent_pai",
+    `:real^3->real^3->real^3->real^3->real^3->(real^3->bool)->bool`);
+   ("quartered_oct",
+    `:real^3->real^3->real^3->real^3->real^3->real^3->(real^3->bool)->bool`);
+   ("strict_qua2", `:(real^3->bool)->(real^3->bool)->(real^3->bool)->bool`);
+   ("strict_qua", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("diagonal", `:real^3->real^3->(real^3->bool)->(real^3->bool)->bool`);
+   ("quarter", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("quasi_reg_tet", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("simplex", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("quasi_tri", `:(real^3->bool)->(real^3->bool)->bool`); ("t0", `:real`);
+   ("voro2", `:real^3->(real^3->bool)->real^3->bool`);
+   ("voronoi2", `:real^3->(real^3->bool)->real^3->bool`);
+   ("d3", `:real^3->real^3->real`);
+   ("centered_pac", `:(real^3->bool)->real^3->bool`);
+   ("center_pac", `:(real^3->bool)->real^3->bool`);
+   ("packing_trg", `:(real^3->bool)->bool`);
+   ("border", `:(real^A->bool)->real^A->bool`);
+   ("conv_trg", `:(real^A->bool)->real^A->bool`);
+   ("conv0_2", `:(real^A->bool)->real^A->bool`);
+   ("voronoi_trg", `:real^A->(real^A->bool)->real^A->bool`);
+   ("ineq", `:(real#real#real)list->bool->bool`);
+   ("abc_param", `:real^A->real^A->real^A->B->real#real#B`);
+   ("make_point",
+    `:real^3->real^3->real^3->real^3->real->real->real->real^3`);
+   ("ortho0", `:real^A->real^A->real^A->real^A->real^A->bool`);
+   ("rcone_lt", `:real^A->real^A->real->real^A->bool`);
+   ("eventually_radial", `:real^A->(real^A->bool)->bool`);
+   ("radial", `:real->real^A->(real^A->bool)->bool`);
+   ("null_equiv", `:(real^3->bool)#(real^3->bool)->bool`);
+   ("packing", `:(real^3->bool)->bool`);
+   ("azim_cycle", `:(real^3->bool)->real^3->real^3->real^3->real^3`);
+   ("projection", `:real^A->real^A->real^A`);
+   ("cyclic_set", `:(real^A->bool)->real^A->real^A->bool`);
+   ("polar_cycle", `:(real#real->bool)->real#real->real#real`);
+   ("cyclic_order", `:real#real->real#real->real#real->bool`);
+   ("radius", `:real#real->real`);
+   ("directed_angle", `:real#real->real#real->real`);
+   ("beta", `:real->real->real`);
+   ("euler_p", `:real^A->real^A->real^A->real^A->real`);
+   ("xlist",
+    `:real^A->real^A->real^A->real^A->real#real#real#real#real#real`);
+   ("ylist",
+    `:real^A->real^A->real^A->real^A->real#real#real#real#real#real`);
+   ("orientation", `:(real^A->bool)->real^A->(real->bool)->bool`);
+   ("radV", `:(real^A->bool)->real`);
+   ("circumcenter", `:(real^A->bool)->real^A`);
+   ("bis_lt", `:real^A->real^A->real^A->bool`);
+   ("bis_le", `:real^A->real^A->real^A->bool`);
+   ("bis", `:real^A->real^A->real^A->bool`);
+   ("open_half_space", `:(real^A->bool)->bool`);
+   ("closed_half_space", `:(real^A->bool)->bool`);
+   ("open_half_plane", `:(real^A->bool)->bool`);
+   ("closed_half_plane", `:(real^A->bool)->bool`);
+   ("line", `:(real^A->bool)->bool`);
+   ("voronoi_le", `:real^A->(real^A->bool)->real^A->bool`);
+   ("voronoi", `:real^A->(real^A->bool)->real^A->bool`);
+   ("aff", `:(real^A->bool)->real^A->bool`);
+   ("rad2_x", `:real->real->real->real->real->real->real`);
+   ("dihR", `:real->real->real->real`); ("solR", `:real->real->real->real`);
+   ("volR", `:real->real->real->real`);
+   ("arclength", `:real->real->real->real`);
+   ("vol_x", `:real->real->real->real->real->real->real`);
+   ("tauq", `:real->real->real->real->real->real->real->real->real->real`);
+   ("taum", `:real->real->real->real->real->real->real`);
+   ("lnazim", `:real->real->real->real->real->real->real`);
+   ("rhazim", `:real->real->real->real->real->real->real`);
+   ("rho", `:real->real`); ("ly", `:real->real`); ("const1", `:real`);
+   ("interp", `:real->real->real->real->real->real`);
+   ("sol_y", `:real->real->real->real->real->real->real`);
+   ("sol_x", `:real->real->real->real->real->real->real`);
+   ("dih3_x", `:real->real->real->real->real->real->real`);
+   ("dih2_x", `:real->real->real->real->real->real->real`);
+   ("dih3_y", `:real->real->real->real->real->real->real`);
+   ("dih2_y", `:real->real->real->real->real->real->real`);
+   ("dih_y", `:real->real->real->real->real->real->real`);
+   ("dih_x", `:real->real->real->real->real->real->real`);
+   ("chi_x", `:real->real->real->real->real->real->real`);
+   ("rho_x", `:real->real->real->real->real->real->real`);
+   ("eta_y", `:real->real->real->real`);
+   ("eta_x", `:real->real->real->real`);
+   ("ups_x", `:real->real->real->real`);
+   ("delta_x6", `:real->real->real->real->real->real->real`);
+   ("delta_x4", `:real->real->real->real->real->real->real`);
+   ("delta_y", `:real->real->real->real->real->real->real`);
+   ("pi_rt18", `:real`); ("sqrt2", `:real`); ("sqrt8", `:real`);
+   ("atn2", `:real#real->real`); ("SDIFF", `:(A->bool)->(A->bool)->A->bool`);
+   ("vol_ball_wedge", `:real^3->real^3->real^3->real^3->real->real`);
+   ("vol_rect", `:real^A->real^B->real`);
+   ("vol_conv", `:real^A->real^A->real^A->real^A->real`);
+   ("vol_conic_cap_wedge",
+    `:real^3->real^3->real^3->real^3->real->real->real`);
+   ("vol_frustt_wedge", `:real^3->real^3->real^3->real^3->real->real->real`);
+   ("vol_solid_triangle", `:real^A->real^A->real^A->real^A->real->real`);
+   ("primitive", `:(real^3->bool)->bool`);
+   ("circular_cone", `:(real^3->bool)->bool`);
+   ("c_cone", `:real^3#real^3#real->real^3->bool`);
+   ("sphere", `:(real^3->bool)->bool`);
+   ("rect", `:real^3->real^3->real^3->bool`);
+   ("solid_triangle", `:real^A->(real^A->bool)->real->real^A->bool`);
+   ("cone0", `:real^A->(real^A->bool)->real^A->bool`);
+   ("cone", `:real^A->(real^A->bool)->real^A->bool`);
+   ("dihV", `:real^A->real^A->real^A->real^A->real`);
+   ("opposite", `:real^N->real^N->(real^N->bool)->bool`);
+   ("wedge", `:real^3->real^3->real^3->real^3->real^3->bool`);
+   ("azim", `:real^3->real^3->real^3->real^3->real`);
+   ("arcV", `:real^A->real^A->real^A->real`);
+   ("orthonormal", `:real^3->real^3->real^3->bool`);
+   ("conic_cap", `:real^A->real^A->real->real->real^A->bool`);
+   ("ellipsoid", `:real^3->real->real^3->bool`);
+   ("normball", `:real^A->real->real^A->bool`);
+   ("scale", `:real^3->real^3->real^3`);
+   ("frustt", `:real^A->real^A->real->real->real^A->bool`);
+   ("frustum", `:real^N->real^N->real->real->real->real^N->bool`);
+   ("rcone_eq", `:real^A->real^A->real->real^A->bool`);
+   ("rcone_ge", `:real^A->real^A->real->real^A->bool`);
+   ("rcone_gt", `:real^A->real^A->real->real^A->bool`);
+   ("rconesgn", `:(real->real->bool)->real^A->real^A->real->real^A->bool`);
+   ("delta_x", `:real->real->real->real->real->real->real`);
+   ("conv0", `:(real^A->bool)->real^A->bool`);
+   ("aff_le", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_lt", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_ge", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_gt", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("sgn_le", `:real->bool`); ("sgn_lt", `:real->bool`);
+   ("sgn_ge", `:real->bool`); ("sgn_gt", `:real->bool`);
+   ("affsign", `:(real->bool)->(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("lin_combo", `:(real^N->bool)->(real^N->real)->real^N`);
+   ("pad2d3d", `:real^2->real^3`); ("plane", `:(real^A->bool)->bool`);
+   ("slice", `:num->real->(real^A->bool)->real^B->bool`);
+   ("pushin", `:num->B->B^A->B^C`); ("dropout", `:num->real^N->real^M`);
+   ("real_measure", `:(real->bool)->real`);
+   ("real_measurable", `:(real->bool)->bool`);
+   ("has_real_measure", `:(real->bool)->real->bool`);
+   ("absolutely_real_integrable_on", `:(real->real)->(real->bool)->bool`);
+   ("real_negligible", `:(real->bool)->bool`);
+   ("real_integral", `:(real->bool)->(real->real)->real`);
+   ("real_integrable_on", `:(real->real)->(real->bool)->bool`);
+   ("has_real_integral", `:(real->real)->real->(real->bool)->bool`);
+   ("closed_real_interval", `:(real#real)list->real->bool`);
+   ("open_real_interval", `:real#real->real->bool`);
+   ("is_realinterval", `:(real->bool)->bool`);
+   ("real_differentiable_on", `:(real->real)->(real->bool)->bool`);
+   ("higher_real_derivative", `:num->(real->real)->real->real`);
+   ("real_derivative", `:(real->real)->real->real`);
+   ("real_differentiable", `:(real->real)->(real)net->bool`);
+   ("has_real_derivative", `:(real->real)->real->(real)net->bool`);
+   ("real_continuous_on", `:(real->real)->(real->bool)->bool`);
+   ("real_continuous", `:(A->real)->(A)net->bool`);
+   ("at_neginfinity", `:(real)net`); ("at_posinfinity", `:(real)net`);
+   ("atreal", `:real->(real)net`);
+   ("real_summable", `:(num->bool)->(num->real)->bool`);
+   ("real_infsum", `:(num->bool)->(num->real)->real`);
+   ("real_sums", `:(num->real)->real->(num->bool)->bool`);
+   ("--->", `:(A->real)->real->(A)net->bool`);
+   ("real_compact", `:(real->bool)->bool`);
+   ("real_bounded", `:(real->bool)->bool`);
+   ("euclideanreal", `:(real)topology`);
+   ("real_closed", `:(real->bool)->bool`);
+   ("real_open", `:(real->bool)->bool`);
+   ("measure", `:(real^A->bool)->real`);
+   ("measurable", `:(real^A->bool)->bool`);
+   ("has_measure", `:(real^A->bool)->real->bool`);
+   ("*_c", `:(A->bool)->(B->bool)->A#B->bool`);
+   ("+_c", `:(A->bool)->(B->bool)->A+B->bool`);
+   ("ordinal", `:(A#A->bool)->bool`);
+   ("linseg", `:(A#A->bool)->A->A#A->bool`);
+   ("inseg", `:(A#A->bool)->(A#A->bool)->bool`);
+   ("woset", `:(A#A->bool)->bool`);
+   ("chain", `:(A#A->bool)->(A->bool)->bool`);
+   ("poset", `:(A#A->bool)->bool`); ("fl", `:(A#A->bool)->A->bool`);
+   ("less", `:(A#A->bool)->A#A->bool`);
+   ("angle", `:real^A#real^A#real^A->real`);
+   ("vector_angle", `:real^A->real^A->real`); ("acs", `:real->real`);
+   ("asn", `:real->real`); ("cacs", `:real^2->real^2`);
+   ("casn", `:real^2->real^2`); ("atn", `:real->real`);
+   ("catn", `:real^2->real^2`); ("unwinding", `:real^2->real^2`);
+   ("cpow", `:real^2->real^2->real^2`); ("clog", `:real^2->real^2`);
+   ("tan", `:real->real`); ("ctan", `:real^2->real^2`);
+   ("rotate2d", `:real->real^2->real^2`); ("Arg", `:real^2->real`);
+   ("pi", `:real`); ("log", `:real->real`); ("cos", `:real->real`);
+   ("sin", `:real->real`); ("exp", `:real->real`);
+   ("csin", `:real^2->real^2`); ("ccos", `:real^2->real^2`);
+   ("cexp", `:real^2->real^2`);
+   ("analytic_on", `:(real^2->real^2)->(real^2->bool)->bool`);
+   ("holomorphic_on", `:(real^2->real^2)->(real^2->bool)->bool`);
+   ("higher_complex_derivative", `:num->(real^2->real^2)->real^2->real^2`);
+   ("complex_derivative", `:(real^2->real^2)->real^2->real^2`);
+   ("complex_differentiable", `:(real^2->real^2)->(real^2)net->bool`);
+   ("has_complex_derivative", `:(real^2->real^2)->real^2->(real^2)net->bool`);
+   ("cproduct", `:(A->bool)->(A->real^2)->real^2`);
+   ("real", `:real^2->bool`); ("csqrt", `:real^2->real^2`);
+   ("cnj", `:real^2->real^2`); ("complex_pow", `:real^2->num->real^2`);
+   ("complex_div", `:real^2->real^2->real^2`);
+   ("complex_inv", `:real^2->real^2`);
+   ("complex_mul", `:real^2->real^2->real^2`); ("ii", `:real^2`);
+   ("Cx", `:real->real^2`); ("complex", `:real#real->real^2`);
+   ("Im", `:real^2->real`); ("Re", `:real^2->real`);
+   ("absolutely_integrable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("negligible", `:(real^A->bool)->bool`);
+   ("indicator", `:(real^M->bool)->real^M->real^1`);
+   ("division_points",
+    `:(real^N->bool)->((real^N->bool)->bool)->num#real->bool`);
+   ("lifted", `:(A->A->B)->(A)option->(A)option->(B)option`);
+   ("operative", `:(A->A->A)->((real^N->bool)->A)->bool`);
+   ("integral", `:(real^A->bool)->(real^A->real^B)->real^B`);
+   ("integrable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("has_integral", `:(real^B->real^A)->real^A->(real^B->bool)->bool`);
+   ("has_integral_compact_interval",
+    `:(real^B->real^A)->real^A->(real^B->bool)->bool`);
+   ("fine", `:(A->B->bool)->(A#(B->bool)->bool)->bool`);
+   ("tagged_division_of",
+    `:(real^A#(real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("tagged_partial_division_of",
+    `:(real^A#(real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("division_of", `:((real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("gauge", `:(real^A->real^A->bool)->bool`);
+   ("content", `:(real^M->bool)->real`);
+   ("interval_lowerbound", `:(real^M->bool)->real^M`);
+   ("interval_upperbound", `:(real^M->bool)->real^M`);
+   ("vector_derivative", `:(real^1->real^N)->(real^1)net->real^N`);
+   ("has_vector_derivative", `:(real^1->real^A)->real^A->(real^1)net->bool`);
+   ("jacobian", `:(real^A->real^B)->(real^A)net->real^A^B`);
+   ("frechet_derivative", `:(real^A->real^B)->(real^A)net->real^A->real^B`);
+   ("differentiable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("differentiable", `:(real^B->real^A)->(real^B)net->bool`);
+   ("has_derivative",
+    `:(real^B->real^A)->(real^B->real^A)->(real^B)net->bool`);
+   ("interval_bij", `:real^N#real^N->real^N#real^N->real^N->real^N`);
+   ("retract_of", `:(real^A->bool)->(real^A->bool)->bool`);
+   ("retraction", `:(real^N->bool)#(real^N->bool)->(real^N->real^N)->bool`);
+   ("reduced", `:((num->num)->num->num)->num->(num->num)->num`);
+   ("ksimplex", `:num->num->((num->num)->bool)->bool`);
+   ("kle", `:num->(num->num)->(num->num)->bool`);
+   ("path_connected", `:(real^A->bool)->bool`);
+   ("path_component", `:(real^A->bool)->real^A->real^A->bool`);
+   ("linepath", `:real^A#real^A->real^1->real^A`);
+   ("shiftpath", `:real^1->(real^1->real^N)->real^1->real^N`);
+   ("arc", `:(real^1->real^N)->bool`);
+   ("simple_path", `:(real^1->real^N)->bool`);
+   ("++", `:(real^1->A)->(real^1->A)->real^1->A`);
+   ("reversepath", `:(real^1->real^N)->real^1->real^N`);
+   ("path_image", `:(real^1->real^N)->real^N->bool`);
+   ("pathfinish", `:(real^1->real^N)->real^N`);
+   ("pathstart", `:(real^1->real^N)->real^N`);
+   ("path", `:(real^1->real^N)->bool`);
+   ("extreme_point_of", `:real^A->(real^A->bool)->bool`);
+   ("face_of", `:(real^A->bool)->(real^A->bool)->bool`);
+   ("relative_interior", `:(real^A->bool)->real^A->bool`);
+   ("starlike", `:(real^A->bool)->bool`);
+   ("epigraph",
+    `:(real^N->bool)->(real^N->real)->real^(N,1)finite_sum->bool`);
+   ("convex_on", `:(real^A->real)->(real^A->bool)->bool`);
+   ("coplanar", `:(real^A->bool)->bool`);
+   ("affine_dependent", `:(real^N->bool)->bool`);
+   ("conic", `:(real^A->bool)->bool`); ("convex", `:(real^A->bool)->bool`);
+   ("affine", `:(real^A->bool)->bool`);
+   ("closest_point", `:(real^A->bool)->real^A->real^A`);
+   ("from", `:num->num->bool`);
+   ("summable", `:(num->bool)->(num->real^A)->bool`);
+   ("infsum", `:(num->bool)->(num->real^A)->real^A`);
+   ("sums", `:(num->real^A)->real^A->(num->bool)->bool`);
+   ("homeomorphic", `:(real^A->bool)->(real^B->bool)->bool`);
+   ("homeomorphism",
+    `:(real^B->bool)#(real^A->bool)->(real^B->real^A)#(real^A->real^B)->bool`);
+   ("open_segment", `:real^A#real^A->real^A->bool`);
+   ("closed_segment", `:(real^A#real^A)list->real^A->bool`);
+   ("is_interval", `:(real^N->bool)->bool`);
+   ("closed_interval", `:(real^N#real^N)list->real^N->bool`);
+   ("open_interval", `:real^N#real^N->real^N->bool`);
+   ("diameter", `:(real^A->bool)->real`);
+   ("connected_component", `:(real^A->bool)->real^A->real^A->bool`);
+   ("uniformly_continuous_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("continuous_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("continuous", `:(B->real^A)->(B)net->bool`);
+   ("complete", `:(real^N->bool)->bool`); ("cauchy", `:(num->real^N)->bool`);
+   ("compact", `:(real^N->bool)->bool`);
+   ("bounded", `:(real^N->bool)->bool`); ("netlimit", `:(A)net->A`);
+   ("lim", `:(A)net->(A->real^B)->real^B`);
+   ("-->", `:(B->real^A)->real^A->(B)net->bool`);
+   ("eventually", `:(A->bool)->(A)net->bool`);
+   ("trivial_limit", `:(A)net->bool`);
+   ("in_direction", `:real^A->real^A->(real^A)net`);
+   ("within", `:(A)net->(A->bool)->(A)net`); ("sequentially", `:(num)net`);
+   ("at_infinity", `:(real^A)net`); ("at", `:real^A->(real^A)net`);
+   ("netord", `:(A)net->A->A->bool`); ("mk_net", `:(A->A->bool)->(A)net`);
+   ("frontier", `:(real^A->bool)->real^A->bool`);
+   ("closure", `:(real^A->bool)->real^A->bool`);
+   ("interior", `:(real^A->bool)->real^A->bool`);
+   ("limit_point_of", `:real^A->(real^A->bool)->bool`);
+   ("connected", `:(real^A->bool)->bool`);
+   ("cball", `:real^A#real->real^A->bool`);
+   ("ball", `:real^A#real->real^A->bool`);
+   ("euclidean", `:(real^A)topology`); ("closed", `:(real^N->bool)->bool`);
+   ("open", `:(real^A->bool)->bool`);
+   ("subtopology", `:(A)topology->(A->bool)->(A)topology`);
+   ("closed_in", `:(A)topology->(A->bool)->bool`);
+   ("topspace", `:(A)topology->A->bool`);
+   ("open_in", `:(A)topology->(A->bool)->bool`);
+   ("topology", `:((A->bool)->bool)->(A)topology`);
+   ("istopology", `:((A->bool)->bool)->bool`);
+   ("ITER", `:num->(A->A)->A->A`); ("frac", `:real->real`);
+   ("floor", `:real->real`); ("integer", `:real->bool`);
+   ("cross", `:real^3->real^3->real^3`);
+   ("rotoinversion_matrix", `:real^A^A->bool`);
+   ("rotation_matrix", `:real^A^A->bool`);
+   ("orthogonal_matrix", `:real^N^N->bool`);
+   ("orthogonal_transformation", `:(real^N->real^N)->bool`);
+   ("det", `:real^N^N->real`); ("trace", `:real^N^N->real`);
+   ("product", `:(A->bool)->(A->real)->real`); ("sign", `:(A->A)->real`);
+   ("evenperm", `:(A->A)->bool`); ("permutation", `:(A->A)->bool`);
+   ("swapseq", `:num->(A->A)->bool`); ("swap", `:A#A->A->A`);
+   ("inverse", `:(B->A)->A->B`); ("permutes", `:(A->A)->(A->bool)->bool`);
+   ("midpoint", `:real^A#real^A->real^A`);
+   ("between", `:real^A->real^A#real^A->bool`);
+   ("collinear", `:(real^A->bool)->bool`); ("infnorm", `:real^N->real`);
+   ("rank", `:real^M^N->num`); ("columnvector", `:real^N->real^1^N`);
+   ("rowvector", `:real^N->real^N^1`); ("dim", `:(real^A->bool)->num`);
+   ("independent", `:(real^A->bool)->bool`);
+   ("dependent", `:(real^A->bool)->bool`);
+   ("span", `:(real^A->bool)->real^A->bool`);
+   ("subspace", `:(real^A->bool)->bool`); ("drop", `:real^1->real`);
+   ("lift", `:real->real^1`); ("onorm", `:(real^M->real^N)->real`);
+   ("matrix", `:(real^M->real^N)->real^M^N`);
+   ("matrix_inv", `:real^N^M->real^M^N`); ("invertible", `:real^N^M->bool`);
+   ("columns", `:real^N^M->real^M->bool`);
+   ("rows", `:real^N^M->real^N->bool`); ("column", `:num->real^N^M->real^M`);
+   ("row", `:num->real^N^M->real^N`); ("transp", `:real^N^M->real^M^N`);
+   ("mat", `:num->real^N^M`);
+   ("vector_matrix_mul", `:real^M->real^N^M->real^N`);
+   ("matrix_vector_mul", `:real^N^M->real^N->real^M`);
+   ("matrix_mul", `:real^N^M->real^P^N->real^P^M`);
+   ("matrix_sub", `:real^N^M->real^N^M->real^N^M`);
+   ("matrix_add", `:real^N^M->real^N^M->real^N^M`);
+   ("matrix_neg", `:real^N^M->real^N^M`);
+   ("adjoint", `:(real^M->real^N)->real^N->real^M`);
+   ("bilinear", `:(real^A->real^B->real^C)->bool`);
+   ("linear", `:(real^M->real^N)->bool`);
+   ("orthogonal", `:real^A->real^A->bool`); ("basis", `:num->real^A`);
+   ("vsum", `:(A->bool)->(A->real^N)->real^N`);
+   ("distance", `:real^A#real^A->real`); ("vector_norm", `:real^A->real`);
+   ("dot", `:real^N->real^N->real`); ("vec", `:num->real^N`);
+   ("%", `:real->real^N->real^N`); ("vector_neg", `:real^N->real^N`);
+   ("vector_sub", `:real^N->real^N->real^N`);
+   ("vector_add", `:real^N->real^N->real^N`); ("sqrt", `:real->real`);
+   ("hull", `:((A->bool)->bool)->(A->bool)->A->bool`);
+   ("inf", `:(real->bool)->real`); ("sup", `:(real->bool)->real`);
+   ("superadmissible",
+    `:(A->A->bool)->((A->C)->B->bool)->(B->A)->((A->C)->B->C)->bool`);
+   ("tailadmissible",
+    `:(A->A->bool)->((A->B)->P->bool)->(P->A)->((A->B)->P->B)->bool`);
+   ("admissible",
+    `:(B->A->bool)->((B->C)->D->bool)->(D->A)->((B->C)->D->E)->bool`);
+   ("CASEWISE", `:((A->C)#(B->A->D))list->B->C->D`);
+   ("vector", `:(A)list->A^N`);
+   ("dest_auto_define_finite_type_3", `:3->num`);
+   ("mk_auto_define_finite_type_3", `:num->3`);
+   ("dest_auto_define_finite_type_2", `:2->num`);
+   ("mk_auto_define_finite_type_2", `:num->2`);
+   ("sndcart", `:A^(M,N)finite_sum->A^N`);
+   ("fstcart", `:A^(M,N)finite_sum->A^M`);
+   ("pastecart", `:A^M->A^N->A^(M,N)finite_sum`);
+   ("dest_finite_sum", `:(A,B)finite_sum->num`);
+   ("mk_finite_sum", `:num->(A,B)finite_sum`); ("lambda", `:(num->A)->A^B`);
+   ("$", `:B^A->num->B`); ("dest_cart", `:A^B->(B)finite_image->A`);
+   ("mk_cart", `:((B)finite_image->A)->A^B`);
+   ("dest_finite_image", `:(A)finite_image->num`);
+   ("finite_index", `:num->(A)finite_image`);
+   ("dimindex", `:(A->bool)->num`); ("sum", `:(A->bool)->(A->real)->real`);
+   ("nsum", `:(A->bool)->(A->num)->num`);
+   ("iterate", `:(B->B->B)->(A->bool)->(A->B)->B`);
+   ("support", `:(B->B->B)->(A->B)->(A->bool)->A->bool`);
+   ("monoidal", `:(A->A->A)->bool`); ("neutral", `:(A->A->A)->A`);
+   ("..", `:num->num->num->bool`); ("COUNTABLE", `:(A->bool)->bool`);
+   (">_c", `:(A->bool)->(B->bool)->bool`);
+   (">=_c", `:(A->bool)->(B->bool)->bool`);
+   ("=_c", `:(A->bool)->(B->bool)->bool`);
+   ("<_c", `:(A->bool)->(B->bool)->bool`);
+   ("<=_c", `:(A->bool)->(B->bool)->bool`);
+   ("PAIRWISE", `:(A->A->bool)->(A)list->bool`);
+   ("pairwise", `:(A->A->bool)->(A->bool)->bool`);
+   ("list_of_set", `:(A->bool)->(A)list`);
+   ("set_of_list", `:(A)list->A->bool`);
+   ("CROSS", `:(A->bool)->(B->bool)->A#B->bool`);
+   ("HAS_SIZE", `:(A->bool)->num->bool`); ("CARD", `:(A->bool)->num`);
+   ("ITSET", `:(A->B->B)->(A->bool)->B->B`);
+   ("FINREC", `:(A->B->B)->B->(A->bool)->B->num->bool`);
+   ("REST", `:(A->bool)->A->bool`); ("CHOICE", `:(A->bool)->A`);
+   ("BIJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("SURJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("INJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("IMAGE", `:(A->B)->(A->bool)->B->bool`);
+   ("INFINITE", `:(A->bool)->bool`); ("FINITE", `:(A->bool)->bool`);
+   ("SING", `:(A->bool)->bool`); ("DISJOINT", `:(A->bool)->(A->bool)->bool`);
+   ("PSUBSET", `:(A->bool)->(A->bool)->bool`);
+   ("SUBSET", `:(A->bool)->(A->bool)->bool`);
+   ("DELETE", `:(A->bool)->A->A->bool`);
+   ("DIFF", `:(A->bool)->(A->bool)->A->bool`);
+   ("INTERS", `:((A->bool)->bool)->A->bool`);
+   ("INTER", `:(A->bool)->(A->bool)->A->bool`);
+   ("UNIONS", `:((A->bool)->bool)->A->bool`);
+   ("UNION", `:(A->bool)->(A->bool)->A->bool`); ("UNIV", `:A->bool`);
+   ("INSERT", `:A->(A->bool)->A->bool`); ("EMPTY", `:A->bool`);
+   ("SETSPEC", `:A->bool->A->bool`); ("GSPEC", `:(A->bool)->A->bool`);
+   ("IN", `:A->(A->bool)->bool`); ("num_gcd", `:num#num->num`);
+   ("num_coprime", `:num#num->bool`); ("num_mod", `:num->num->num->bool`);
+   ("num_divides", `:num->num->bool`); ("num_of_int", `:int->num`);
+   ("int_gcd", `:int#int->int`); ("int_coprime", `:int#int->bool`);
+   ("int_mod", `:int->int->int->bool`); ("int_divides", `:int->int->bool`);
+   ("real_mod", `:real->real->real->bool`);
+   ("==", `:A->A->(A->A->bool)->bool`); ("rem", `:int->int->int`);
+   ("div", `:int->int->int`); ("int_pow", `:int->num->int`);
+   ("int_min", `:int->int->int`); ("int_max", `:int->int->int`);
+   ("int_abs", `:int->int`); ("int_mul", `:int->int->int`);
+   ("int_sub", `:int->int->int`); ("int_add", `:int->int->int`);
+   ("int_neg", `:int->int`); ("int_of_num", `:num->int`);
+   ("int_gt", `:int->int->bool`); ("int_ge", `:int->int->bool`);
+   ("int_lt", `:int->int->bool`); ("int_le", `:int->int->bool`);
+   ("real_of_int", `:int->real`); ("int_of_real", `:real->int`);
+   ("is_int", `:real->bool`); ("DECIMAL", `:num->num->real`);
+   ("real_min", `:real->real->real`); ("real_max", `:real->real->real`);
+   ("real_div", `:real->real->real`); ("real_pow", `:real->num->real`);
+   ("real_abs", `:real->real`); ("real_gt", `:real->real->bool`);
+   ("real_ge", `:real->real->bool`); ("real_lt", `:real->real->bool`);
+   ("real_sub", `:real->real->real`); ("real_inv", `:real->real`);
+   ("real_le", `:real->real->bool`); ("real_mul", `:real->real->real`);
+   ("real_add", `:real->real->real`); ("real_neg", `:real->real`);
+   ("real_of_num", `:num->real`); ("dest_real", `:real->hreal#hreal->bool`);
+   ("mk_real", `:(hreal#hreal->bool)->real`);
+   ("treal_eq", `:hreal#hreal->hreal#hreal->bool`);
+   ("treal_inv", `:hreal#hreal->hreal#hreal`);
+   ("treal_le", `:hreal#hreal->hreal#hreal->bool`);
+   ("treal_mul", `:hreal#hreal->hreal#hreal->hreal#hreal`);
+   ("treal_add", `:hreal#hreal->hreal#hreal->hreal#hreal`);
+   ("treal_neg", `:hreal#hreal->hreal#hreal`);
+   ("treal_of_num", `:num->hreal#hreal`); ("hreal_inv", `:hreal->hreal`);
+   ("hreal_le", `:hreal->hreal->bool`);
+   ("hreal_mul", `:hreal->hreal->hreal`);
+   ("hreal_add", `:hreal->hreal->hreal`); ("hreal_of_num", `:num->hreal`);
+   ("dest_hreal", `:hreal->nadd->bool`);
+   ("mk_hreal", `:(nadd->bool)->hreal`); ("nadd_inv", `:nadd->nadd`);
+   ("nadd_rinv", `:nadd->num->num`); ("nadd_mul", `:nadd->nadd->nadd`);
+   ("nadd_add", `:nadd->nadd->nadd`); ("nadd_le", `:nadd->nadd->bool`);
+   ("nadd_of_num", `:num->nadd`); ("nadd_eq", `:nadd->nadd->bool`);
+   ("dest_nadd", `:nadd->num->num`); ("mk_nadd", `:(num->num)->nadd`);
+   ("is_nadd", `:(num->num)->bool`); ("dist", `:num#num->num`);
+   ("ASCII", `:bool->bool->bool->bool->bool->bool->bool->bool->char`);
+   ("_16756", `:bool->bool->bool->bool->bool->bool->bool->bool->char`);
+   ("_dest_char", `:char->(bool#bool#bool#bool#bool#bool#bool#bool)recspace`);
+   ("_mk_char", `:(bool#bool#bool#bool#bool#bool#bool#bool)recspace->char`);
+   ("ZIP", `:(A)list->(B)list->(A#B)list`);
+   ("ITLIST2", `:(A->B->C->C)->(A)list->(B)list->C->C`);
+   ("ASSOC", `:A->(A#B)list->B`); ("FILTER", `:(A->bool)->(A)list->(A)list`);
+   ("EL", `:num->(A)list->A`);
+   ("MAP2", `:(A->B->C)->(A)list->(B)list->(C)list`);
+   ("ALL2", `:(A->B->bool)->(A)list->(B)list->bool`);
+   ("MEM", `:A->(A)list->bool`); ("ITLIST", `:(A->B->B)->(A)list->B->B`);
+   ("EX", `:(A->bool)->(A)list->bool`); ("ALL", `:(A->bool)->(A)list->bool`);
+   ("NULL", `:(A)list->bool`); ("REPLICATE", `:num->A->(A)list`);
+   ("LAST", `:(A)list->A`); ("MAP", `:(A->B)->(A)list->(B)list`);
+   ("LENGTH", `:(A)list->num`); ("REVERSE", `:(A)list->(A)list`);
+   ("APPEND", `:(A)list->(A)list->(A)list`); ("TL", `:(A)list->(A)list`);
+   ("HD", `:(A)list->A`); ("ISO", `:(A->B)->(B->A)->bool`);
+   ("CONS", `:A->(A)list->(A)list`); ("NIL", `:(A)list`);
+   ("_dest_list", `:(A)list->(A)recspace`);
+   ("_mk_list", `:(A)recspace->(A)list`); ("SOME", `:A->(A)option`);
+   ("NONE", `:(A)option`); ("_dest_option", `:(A)option->(A)recspace`);
+   ("_mk_option", `:(A)recspace->(A)option`); ("OUTR", `:A+B->B`);
+   ("OUTL", `:A+B->A`); ("INR", `:B->A+B`); ("INL", `:A->A+B`);
+   ("_dest_sum", `:A+B->(A#B)recspace`); ("_mk_sum", `:(A#B)recspace->A+B`);
+   ("FNIL", `:num->A`); ("FCONS", `:A->(num->A)->num->A`);
+   ("CONSTR", `:num->A->(num->(A)recspace)->(A)recspace`);
+   ("BOTTOM", `:(A)recspace`); ("_dest_rec", `:(A)recspace->num->A->bool`);
+   ("_mk_rec", `:(num->A->bool)->(A)recspace`);
+   ("ZRECSPACE", `:(num->A->bool)->bool`); ("ZBOT", `:num->A->bool`);
+   ("ZCONSTR", `:num->A->(num->num->A->bool)->num->A->bool`);
+   ("INJP", `:(num->A->bool)->(num->A->bool)->num->A->bool`);
+   ("INJF", `:(num->num->A->bool)->num->A->bool`);
+   ("INJA", `:A->num->A->bool`); ("INJN", `:num->num->A->bool`);
+   ("NUMRIGHT", `:num->num`); ("NUMLEFT", `:num->bool`);
+   ("NUMSUM", `:bool->num->num`); ("NUMSND", `:num->num`);
+   ("NUMFST", `:num->num`); ("NUMPAIR", `:num->num->num`);
+   ("MEASURE", `:(A->num)->A->A->bool`); ("WF", `:(A->A->bool)->bool`);
+   ("minimal", `:(num->bool)->num`); ("MIN", `:num->num->num`);
+   ("MAX", `:num->num->num`); ("MOD", `:num->num->num`);
+   ("DIV", `:num->num->num`); ("FACT", `:num->num`); ("-", `:num->num->num`);
+   ("ODD", `:num->bool`); ("EVEN", `:num->bool`); (">", `:num->num->bool`);
+   (">=", `:num->num->bool`); ("<", `:num->num->bool`);
+   ("<=", `:num->num->bool`); ("EXP", `:num->num->num`);
+   ("*", `:num->num->num`); ("BIT1", `:num->num`); ("BIT0", `:num->num`);
+   ("+", `:num->num->num`); ("PRE", `:num->num`); ("NUMERAL", `:num->num`);
+   ("SUC", `:num->num`); ("_0", `:num`); ("dest_num", `:num->ind`);
+   ("mk_num", `:ind->num`); ("NUM_REP", `:ind->bool`); ("IND_0", `:ind`);
+   ("IND_SUC", `:ind->ind`); ("ONTO", `:(A->B)->bool`);
+   ("ONE_ONE", `:(A->B)->bool`); ("PASSOC", `:((A#B)#C->D)->A#B#C->D`);
+   ("UNCURRY", `:(A->B->C)->A#B->C`); ("CURRY", `:(A#B->C)->A->B->C`);
+   ("SND", `:A#B->B`); ("FST", `:A#B->A`); (",", `:A->B->A#B`);
+   ("REP_prod", `:A#B->A->B->bool`); ("ABS_prod", `:(A->B->bool)->A#B`);
+   ("mk_pair", `:A->B->A->B->bool`); ("_FUNCTION", `:(A->B->bool)->A->B`);
+   ("_MATCH", `:A->(A->B->bool)->B`);
+   ("_GUARDED_PATTERN", `:bool->bool->bool->bool`);
+   ("_UNGUARDED_PATTERN", `:bool->bool->bool`);
+   ("_SEQPATTERN", `:(A->B->bool)->(A->B->bool)->A->B->bool`);
+   ("GEQ", `:A->A->bool`); ("GABS", `:(A->bool)->A`); ("LET_END", `:A->A`);
+   ("LET", `:(A->B)->A->B`); ("one", `:1`); ("one_REP", `:1->bool`);
+   ("one_ABS", `:bool->1`); ("I", `:A->A`); ("o", `:(B->C)->(A->B)->A->C`);
+   ("COND", `:bool->A->A->A`); ("@", `:(A->bool)->A`);
+   ("_FALSITY_", `:bool`); ("?!", `:(A->bool)->bool`); ("~", `:bool->bool`);
+   ("F", `:bool`); ("\\/", `:bool->bool->bool`); ("?", `:(A->bool)->bool`);
+   ("!", `:(A->bool)->bool`); ("==>", `:bool->bool->bool`);
+   ("/\\", `:bool->bool->bool`); ("T", `:bool`); ("=", `:A->A->bool`)];;
+
+  let the_loaded_files = 
+      ["flyspeck_utility.hl"; "update_database_310.ml"; "hypermap.hl"; "vol1.hl";
+   "trigonometry.hl"; "database2194fe.ml"; "flyspeck_utility.hl"; "trig2.hl";
+   "trig1.hl"; "ineqdata3q1h.hl"; "ineq.hl"; "enclosed_def.hl";
+   "quadratic_root_plus_def.hl"; "abc_of_quadratic_def.hl"; "muR_def.hl";
+   "collect_geom.hl"; "cayleyR_def.hl"; "affprops.hl"; "AFF_SGN_TAC.hl";
+   "geomdetail.hl"; "snapshot.hl"; "snapshot.hl"; "snapshot.hl";
+   "snapshot.hl"; "snapshot.hl"; "sphere.hl"; "prove_by_refinement.hl";
+   "update_database_310.ml"; "database3be71a.ml"; "snapshot.hl";
+   "print-types.ml"; "flyspeck.ml"; "wlog_examples.ml"; "wlog.ml"; "real.ml";
+   "measure.ml"; "card.ml"; "wo.ml"; "geom.ml"; "transc.ml"; "canal.ml";
+   "complex.ml"; "integration.ml"; "analysis.ml"; "dimension.ml";
+   "convex.ml"; "topology.ml"; "iter.ml"; "floor.ml"; "cross.ml";
+   "determinants.ml"; "products.ml"; "permutations.ml"; "vectors.ml";
+   "misc.ml"; "database.ml"; "help.ml"; "define.ml"; "cart.ml"; "iter.ml";
+   "sets.ml"; "int.ml"; "calc_rat.ml"; "real.ml"; "realarith.ml";
+   "calc_int.ml"; "realax.ml"; "list.ml"; "ind-types.ml"; "grobner.ml";
+   "normalizer.ml"; "calc_num.ml"; "wf.ml"; "arith.ml"; "num.ml"; "pair.ml";
+   "recursion.ml"; "quot.ml"; "meson.ml"; "canon.ml"; "trivia.ml";
+   "class.ml"; "ind-defs.ml"; "theorems.ml"; "simp.ml"; "itab.ml";
+   "tactics.ml"; "drule.ml"; "bool.ml"; "equal.ml"; "printer.ml";
+   "parser.ml"; "preterm.ml"; "nets.ml"; "basics.ml"; "fusion.ml"; "lib.ml";
+   "sys.ml"];;
+
+  let the_types =   [("loop", 1); ("hypermap", 1); ("net", 1); ("topology", 1); ("3", 0);
+   ("2", 0); ("finite_sum", 2); ("cart", 2); ("finite_image", 1); ("int", 0);
+   ("real", 0); ("hreal", 0); ("nadd", 0); ("char", 0); ("list", 1);
+   ("option", 1); ("sum", 2); ("recspace", 1); ("num", 0); ("ind", 0);
+   ("prod", 2); ("1", 0); ("bool", 0); ("fun", 2)];;
+
+  let the_overload_skeletons = Snapshot_v220_7_31_2009.the_overload_skeletons;;
+  
+end;;
diff --git a/development/thales/chaff/general/flyshot2.hl b/development/thales/chaff/general/flyshot2.hl
new file mode 100644 (file)
index 0000000..1afd9bf
--- /dev/null
@@ -0,0 +1,737 @@
+
+
+module Snapshot_flyspeck_build_2010_02_12  = struct
+  (* contains hypermap types, so must be loaded late in the build *)
+  let hol_version =  "2.20++";;
+  let hol_snapshot = "7_31_09";;
+  let svn_version = 1524;;  (* I think, I didn't make a careful record. Definitely pre-1525. *)
+  let the_filetable =   [("general/flyspeck_utility.hl", 832);
+   ("general/update_database_310.ml", 832); ("hypermap/hypermap.hl", 832);
+   ("volume/vol1.hl", 737); ("trigonometry/trigonometry.hl", 719);
+   ("general/flyspeck_utility.hl", 717); ("trigonometry/trig2.hl", 717);
+   ("trigonometry/trig1.hl", 708); ("nonlinear/ineqdata3q1h.hl", 707);
+   ("nonlinear/ineq.hl", 707); ("leg/enclosed_def.hl", 707);
+   ("leg/quadratic_root_plus_def.hl", 706);
+   ("leg/abc_of_quadratic_def.hl", 705); ("leg/muR_def.hl", 704);
+   ("leg/collect_geom.hl", 703); ("leg/cayleyR_def.hl", 678);
+   ("leg/affprops.hl", 677); ("leg/AFF_SGN_TAC.hl", 677);
+   ("leg/geomdetail.hl", 677); ("pervasives", 673)];;
+  let the_constants = 
+  [ (* ("geomdetail'simplex", `:(real^3->bool)->(real^3->bool)->bool`); *)
+   ("map3", `:real^3->real^3->real^3`);
+   ("canon", `:(A)hypermap->((A)loop->bool)->((A->bool)->bool)->bool`);
+   ("is_flag", `:(A)hypermap->((A->bool)->bool)->bool`);
+   ("is_gen_flag", `:(A)hypermap->(A->bool)->((A->bool)->bool)->bool`);
+   ("edge_nondegenerate", `:(A)hypermap->bool`);
+   ("face_collection", `:(A)hypermap->(A)loop->bool`);
+   ("face_loop", `:(A)hypermap->A->(A)loop`);
+   ("res", `:(A->A)->(A->bool)->A->A`);
+   ("team", `:(A)hypermap->(A)loop->(A->bool)->bool`);
+   ("iso", `:(A)hypermap->(B)hypermap->bool`);
+   ("quotient", `:(A)hypermap->((A)loop->bool)->(A->bool)hypermap`);
+   ("nmap", `:(A)hypermap->((A)loop->bool)->(A->bool)->A->bool`);
+   ("fmap", `:(A)hypermap->((A)loop->bool)->(A->bool)->A->bool`);
+   ("tail", `:(A)hypermap->((A)loop->bool)->A->A`);
+   ("head", `:(A)hypermap->((A)loop->bool)->A->A`);
+   ("choice", `:(A)hypermap->((A)loop->bool)->A->A->bool`);
+   ("support_darts", `:((A)loop->bool)->A->bool`);
+   ("quotient_darts", `:(A)hypermap->((A)loop->bool)->(A->bool)->bool`);
+   ("is_normal", `:(A)hypermap->((A)loop->bool)->bool`);
+   ("atom", `:(A)hypermap->(A)loop->A->A->bool`);
+   ("is_node_going", `:(A)hypermap->(A)loop->A->A->bool`);
+   ("in_path", `:(num->A)->num->A->bool`);
+   ("set_dart_of", `:(num->A)->num->A->bool`);
+   ("contour_of", `:(A)loop->A->num->A`);
+   ("is_loop", `:(A)hypermap->(A)loop->bool`); ("top", `:(A)loop->num`);
+   ("size", `:(A)loop->num`); ("inside", `:A->(A)loop->bool`);
+   ("back", `:(A)loop->A->A`); ("next", `:(A)loop->A->A`);
+   ("dart_of", `:(A)loop->A->bool`);
+   ("tuple_loop", `:(A)loop->(A->bool)#(A->A)`);
+   ("loop", `:(A->bool)#(A->A)->(A)loop`);
+   ("shift_path", `:(num->A)->num->num->A`);
+   ("is_Moebius_contour", `:(A)hypermap->(num->A)->num->bool`);
+   ("is_splitting_component", `:(A)hypermap->A->bool`);
+   ("planar_ind", `:(A)hypermap->real`);
+   ("is_face_split", `:(A)hypermap->A->bool`);
+   ("is_node_split", `:(A)hypermap->A->bool`);
+   ("is_edge_split", `:(A)hypermap->A->bool`);
+   ("is_face_merge", `:(A)hypermap->A->bool`);
+   ("is_node_merge", `:(A)hypermap->A->bool`);
+   ("is_edge_merge", `:(A)hypermap->A->bool`);
+   ("inj_orbit", `:(A->A)->A->num->bool`);
+   ("double_face_walkup", `:(A)hypermap->A->A->(A)hypermap`);
+   ("double_node_walkup", `:(A)hypermap->A->A->(A)hypermap`);
+   ("double_edge_walkup", `:(A)hypermap->A->A->(A)hypermap`);
+   ("face_walkup", `:(A)hypermap->A->(A)hypermap`);
+   ("node_walkup", `:(A)hypermap->A->(A)hypermap`);
+   ("edge_walkup", `:(A)hypermap->A->(A)hypermap`);
+   ("shift", `:(A)hypermap->(A)hypermap`);
+   ("is_face_degenerate", `:(A)hypermap->A->bool`);
+   ("is_node_degenerate", `:(A)hypermap->A->bool`);
+   ("is_edge_degenerate", `:(A)hypermap->A->bool`);
+   ("isolated_dart", `:(A)hypermap->A->bool`);
+   ("is_inj_contour", `:(A)hypermap->(num->A)->num->bool`);
+   ("face_contour", `:(A)hypermap->A->num->A`);
+   ("node_contour", `:(A)hypermap->A->num->A`);
+   ("is_contour", `:(A)hypermap->(num->A)->num->bool`);
+   ("one_step_contour", `:(A)hypermap->A->A->bool`);
+   ("face_path", `:(A)hypermap->A->num->A`);
+   ("node_path", `:(A)hypermap->A->num->A`);
+   ("edge_path", `:(A)hypermap->A->num->A`);
+   ("connected_hypermap", `:(A)hypermap->bool`);
+   ("dart_nondegenerate", `:(A)hypermap->A->bool`);
+   ("dart_degenerate", `:(A)hypermap->A->bool`);
+   ("simple_hypermap", `:(A)hypermap->bool`);
+   ("planar_hypermap", `:(A)hypermap->bool`);
+   ("plain_hypermap", `:(A)hypermap->bool`);
+   ("number_of_components", `:(A)hypermap->num`);
+   ("number_of_faces", `:(A)hypermap->num`);
+   ("number_of_nodes", `:(A)hypermap->num`);
+   ("number_of_edges", `:(A)hypermap->num`);
+   ("set_of_components", `:(A)hypermap->(A->bool)->bool`);
+   ("set_part_components", `:(A)hypermap->(A->bool)->(A->bool)->bool`);
+   ("set_components", `:(A)hypermap->(A->bool)->(A->bool)->bool`);
+   ("face_set", `:(A)hypermap->(A->bool)->bool`);
+   ("node_set", `:(A)hypermap->(A->bool)->bool`);
+   ("edge_set", `:(A)hypermap->(A->bool)->bool`);
+   ("number_of_orbits", `:(A->bool)->(A->A)->num`);
+   ("set_of_orbits", `:(A->bool)->(A->A)->(A->bool)->bool`);
+   ("comb_component", `:(A)hypermap->A->A->bool`);
+   ("is_in_component", `:(A)hypermap->A->A->bool`);
+   ("is_path", `:(A)hypermap->(num->A)->num->bool`);
+   ("go_one_step", `:(A)hypermap->A->A->bool`);
+   ("face", `:(A)hypermap->A->A->bool`);
+   ("node", `:(A)hypermap->A->A->bool`);
+   ("edge", `:(A)hypermap->A->A->bool`); ("face_map", `:(A)hypermap->A->A`);
+   ("node_map", `:(A)hypermap->A->A`); ("edge_map", `:(A)hypermap->A->A`);
+   ("dart", `:(A)hypermap->A->bool`);
+   ("tuple_hypermap", `:(A)hypermap->(A->bool)#(A->A)#(A->A)#(A->A)`);
+   ("hypermap", `:(A->bool)#(A->A)#(A->A)#(A->A)->(A)hypermap`);
+   ("orbit_map", `:(A->A)->A->A->bool`); ("POWER", `:(A->A)->num->A->A`);
+   ("integer_point", `:(real^3->bool)->real^3->bool`);
+   ("map1", `:real^3->real^3->bool`);
+   ("close_hinhcau", `:real^3->real->real^3->bool`);
+   ("set_of_ccube", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("ccube", `:real^3->real^3->bool`);
+   ("vector_to_pair", `:real^3->real#real#real`);
+   ("int_interval", `:real->real->real->bool`);
+   ("map0", `:real^3->real^3->bool`);
+   ("union_of_int_cube", `:real^3->real->real^3->bool`);
+   ("int_ball", `:real^3->real->real^3->bool`);
+   ("union_of_cube", `:real^3->real->real^3->bool`);
+   ("set_of_cube", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("hinhcau", `:real^3->real->real^3->bool`);
+   ("cube", `:real^3->real^3->bool`);
+   ("sol", `:(real^3->bool)->real^3->real`);
+   ("volume_prop_fix", `:((real^3->bool)->real)->bool`);
+   ("eventually_radial_norm", `:real^A->(real^A->bool)->bool`);
+   ("radial_norm", `:real->real^A->(real^A->bool)->bool`);
+   ("parallel", `:real^N->real^N->bool`); ("unknown", `:bool`);
+   ("arg_diff", `:real^2->real^2->real`); ("pl_angle", `:real^2->real`);
+   ("polar_cycle_on", `:(real^2->real^2)->(real^2->bool)->bool`);
+   ("polar_le", `:real^2->real^2->bool`);
+   ("polar_lt", `:real^2->real^2->bool`); ("tri_itv", `:real->bool`);
+   ("real_itv", `:real->real->real->bool`);
+   ("sinV", `:real^A->real^A->real`); ("cosV", `:real^A->real^A->real`);
+   ("atan2_temp", `:real#real->real`);
+   ("enclosed",
+    `:real->real->real->real->real->real->real->real->real->real`);
+   ("quadratic_root_plus", `:real#real#real->real`);
+   ("abc_of_quadratic", `:(real->real)->real#real#real`);
+   ("muR",
+    `:real->real->real->real->real->real->real->real->real->real->real`);
+   ("muy_v", `:real^N->real^N->real^N->real^N->real^N->real->real`);
+   ("muy_delta", `:real->real->real->real->real->real->real`);
+   ("det_vec3", `:real^3->real^3->real^3->real`);
+   ("condA",
+    `:real^3->real^3->real^3->real^3->real->real->real->real->real->A->bool`);
+   ("coplanar_alt", `:(real^A->bool)->bool`);
+   ("cayleytr",
+    `:real->real->real->real->real->real->real->real->real->real->real`);
+   ("delta_x14", `:real->real->real->real->real->real->real`);
+   ("delta_x13", `:real->real->real->real->real->real->real`);
+   ("delta_x12", `:real->real->real->real->real->real->real`);
+   ("coef3", `:real^N->real^N->real^N->real^N->real`);
+   ("coef2", `:real^N->real^N->real^N->real^N->real`);
+   ("coef1", `:real^N->real^N->real^N->real^N->real`);
+   ("c_coef", `:real->real->real->real->real->real`);
+   ("b_coef", `:real->real->real->real->real->real`);
+   ("cm3_ups_x", `:real^3->real^3->real^3->real`);
+   ("plane_3p", `:real^3->real^3->real^3->real^3->bool`);
+   ("delta_x34", `:real->real->real->real->real->real->real`);
+   ("plane_norm", `:(real^A->bool)->bool`);
+   ("ups_x_pow2", `:real->real->real->real`);
+   ("max_real3", `:real->real->real->real`);
+   ("max_real", `:real->real->real`);
+   ("eta_v", `:real^N->real^N->real^N->real`);
+   ("delta", `:real->real->real->real->real->real->real`);
+   ("chi", `:real->real->real->real->real->real->real`);
+   ("rho_ij", `:real->real->real->real->real->real->real`);
+   ("cayleyR",
+    `:real->real->real->real->real->real->real->real->real->real->real`);
+   ("min_dist", `:real^3->(real^3->bool)->bool`);
+   ("e_plane", `:real^N->real^N->real^N->bool`);
+   ("near2t0", `:real^A->(real^A->bool)->real^A->bool`);
+   ("near", `:real^N->real->(real^N->bool)->real^N->bool`);
+   ("VC_INFI", `:(real^3->bool)->real^3->bool`);
+   ("VC", `:real^3->(real^3->bool)->real^3->bool`);
+   ("lambda_y", `:real^3->(real^3->bool)->real^3->bool`);
+   ("lambda_x", `:real^3->(real^3->bool)->real^3->bool`);
+   ("VC_INFI_trg", `:(real^3->bool)->real^3->bool`);
+   ("VC_trg", `:real^3->(real^3->bool)->real^3->bool`);
+   ("unobstructed", `:real^3->real^3->(real^3->bool)->bool`);
+   ("obstruct", `:real^3->real^3->(real^3->bool)->bool`);
+   ("conv", `:(real^A->bool)->real^A->bool`);
+   ("obstructed", `:real^3->real^3->(real^3->bool)->bool`);
+   ("barrier", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("Q_SYS", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("anchor_points", `:real^3->real^3->(real^3->bool)->real^3->bool`);
+   ("anchor", `:real^3->real^3->real^3->(real^3->bool)->bool`);
+   ("isolated_pai", `:(real^3->bool)->(real^3->bool)->(real^3->bool)->bool`);
+   ("isolated_qua", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("interior_pos",
+    `:real^3->real^3->real^3->real^3->real^3->(real^3->bool)->bool`);
+   ("conflicting_dia",
+    `:real^3->real^3->real^3->real^3->real^3->(real^3->bool)->bool`);
+   ("adjacent_pai",
+    `:real^3->real^3->real^3->real^3->real^3->(real^3->bool)->bool`);
+   ("quartered_oct",
+    `:real^3->real^3->real^3->real^3->real^3->real^3->(real^3->bool)->bool`);
+   ("strict_qua2", `:(real^3->bool)->(real^3->bool)->(real^3->bool)->bool`);
+   ("strict_qua", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("diagonal", `:real^3->real^3->(real^3->bool)->(real^3->bool)->bool`);
+   ("quarter", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("quasi_reg_tet", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("simplex", `:(real^3->bool)->(real^3->bool)->bool`);
+   ("quasi_tri", `:(real^3->bool)->(real^3->bool)->bool`); ("t0", `:real`);
+   ("voro2", `:real^3->(real^3->bool)->real^3->bool`);
+   ("voronoi2", `:real^3->(real^3->bool)->real^3->bool`);
+   ("d3", `:real^3->real^3->real`);
+   ("centered_pac", `:(real^3->bool)->real^3->bool`);
+   ("center_pac", `:(real^3->bool)->real^3->bool`);
+   ("packing_trg", `:(real^3->bool)->bool`);
+   ("border", `:(real^A->bool)->real^A->bool`);
+   ("conv_trg", `:(real^A->bool)->real^A->bool`);
+   ("conv0_2", `:(real^A->bool)->real^A->bool`);
+   ("voronoi_trg", `:real^A->(real^A->bool)->real^A->bool`);
+   ("ineq", `:(real#real#real)list->bool->bool`);
+   ("abc_param", `:real^A->real^A->real^A->B->real#real#B`);
+   ("make_point",
+    `:real^3->real^3->real^3->real^3->real->real->real->real^3`);
+   ("ortho0", `:real^A->real^A->real^A->real^A->real^A->bool`);
+   ("rcone_lt", `:real^A->real^A->real->real^A->bool`);
+   ("eventually_radial", `:real^A->(real^A->bool)->bool`);
+   ("radial", `:real->real^A->(real^A->bool)->bool`);
+   ("null_equiv", `:(real^3->bool)#(real^3->bool)->bool`);
+   ("packing", `:(real^3->bool)->bool`);
+   ("azim_cycle", `:(real^3->bool)->real^3->real^3->real^3->real^3`);
+   ("projection", `:real^A->real^A->real^A`);
+   ("cyclic_set", `:(real^A->bool)->real^A->real^A->bool`);
+   ("polar_cycle", `:(real#real->bool)->real#real->real#real`);
+   ("cyclic_order", `:real#real->real#real->real#real->bool`);
+   ("radius", `:real#real->real`);
+   ("directed_angle", `:real#real->real#real->real`);
+   ("beta", `:real->real->real`);
+   ("euler_p", `:real^A->real^A->real^A->real^A->real`);
+   ("xlist",
+    `:real^A->real^A->real^A->real^A->real#real#real#real#real#real`);
+   ("ylist",
+    `:real^A->real^A->real^A->real^A->real#real#real#real#real#real`);
+   ("orientation", `:(real^A->bool)->real^A->(real->bool)->bool`);
+   ("radV", `:(real^A->bool)->real`);
+   ("circumcenter", `:(real^A->bool)->real^A`);
+   ("bis_lt", `:real^A->real^A->real^A->bool`);
+   ("bis_le", `:real^A->real^A->real^A->bool`);
+   ("bis", `:real^A->real^A->real^A->bool`);
+   ("open_half_space", `:(real^A->bool)->bool`);
+   ("closed_half_space", `:(real^A->bool)->bool`);
+   ("open_half_plane", `:(real^A->bool)->bool`);
+   ("closed_half_plane", `:(real^A->bool)->bool`);
+   ("line", `:(real^A->bool)->bool`);
+   ("voronoi_le", `:real^A->(real^A->bool)->real^A->bool`);
+   ("voronoi", `:real^A->(real^A->bool)->real^A->bool`);
+   ("aff", `:(real^A->bool)->real^A->bool`);
+   ("rad2_x", `:real->real->real->real->real->real->real`);
+   ("dihR", `:real->real->real->real`); ("solR", `:real->real->real->real`);
+   ("volR", `:real->real->real->real`);
+   ("arclength", `:real->real->real->real`);
+   ("vol_x", `:real->real->real->real->real->real->real`);
+   ("tauq", `:real->real->real->real->real->real->real->real->real->real`);
+   ("taum", `:real->real->real->real->real->real->real`);
+   ("lnazim", `:real->real->real->real->real->real->real`);
+   ("rhazim", `:real->real->real->real->real->real->real`);
+   ("rho", `:real->real`); ("ly", `:real->real`); ("const1", `:real`);
+   ("interp", `:real->real->real->real->real->real`);
+   ("sol_y", `:real->real->real->real->real->real->real`);
+   ("sol_x", `:real->real->real->real->real->real->real`);
+   ("dih3_x", `:real->real->real->real->real->real->real`);
+   ("dih2_x", `:real->real->real->real->real->real->real`);
+   ("dih3_y", `:real->real->real->real->real->real->real`);
+   ("dih2_y", `:real->real->real->real->real->real->real`);
+   ("dih_y", `:real->real->real->real->real->real->real`);
+   ("dih_x", `:real->real->real->real->real->real->real`);
+   ("chi_x", `:real->real->real->real->real->real->real`);
+   ("rho_x", `:real->real->real->real->real->real->real`);
+   ("eta_y", `:real->real->real->real`);
+   ("eta_x", `:real->real->real->real`);
+   ("ups_x", `:real->real->real->real`);
+   ("delta_x6", `:real->real->real->real->real->real->real`);
+   ("delta_x4", `:real->real->real->real->real->real->real`);
+   ("delta_y", `:real->real->real->real->real->real->real`);
+   ("pi_rt18", `:real`); ("sqrt2", `:real`); ("sqrt8", `:real`);
+   ("atn2", `:real#real->real`); ("SDIFF", `:(A->bool)->(A->bool)->A->bool`);
+   ("vol_ball_wedge", `:real^3->real^3->real^3->real^3->real->real`);
+   ("vol_rect", `:real^A->real^B->real`);
+   ("vol_conv", `:real^A->real^A->real^A->real^A->real`);
+   ("vol_conic_cap_wedge",
+    `:real^3->real^3->real^3->real^3->real->real->real`);
+   ("vol_frustt_wedge", `:real^3->real^3->real^3->real^3->real->real->real`);
+   ("vol_solid_triangle", `:real^A->real^A->real^A->real^A->real->real`);
+   ("primitive", `:(real^3->bool)->bool`);
+   ("circular_cone", `:(real^3->bool)->bool`);
+   ("c_cone", `:real^3#real^3#real->real^3->bool`);
+   ("sphere", `:(real^3->bool)->bool`);
+   ("rect", `:real^3->real^3->real^3->bool`);
+   ("solid_triangle", `:real^A->(real^A->bool)->real->real^A->bool`);
+   ("cone0", `:real^A->(real^A->bool)->real^A->bool`);
+   ("cone", `:real^A->(real^A->bool)->real^A->bool`);
+   ("dihV", `:real^A->real^A->real^A->real^A->real`);
+   ("opposite", `:real^N->real^N->(real^N->bool)->bool`);
+   ("wedge", `:real^3->real^3->real^3->real^3->real^3->bool`);
+   ("azim", `:real^3->real^3->real^3->real^3->real`);
+   ("arcV", `:real^A->real^A->real^A->real`);
+   ("orthonormal", `:real^3->real^3->real^3->bool`);
+   ("conic_cap", `:real^A->real^A->real->real->real^A->bool`);
+   ("ellipsoid", `:real^3->real->real^3->bool`);
+   ("normball", `:real^A->real->real^A->bool`);
+   ("scale", `:real^3->real^3->real^3`);
+   ("frustt", `:real^A->real^A->real->real->real^A->bool`);
+   ("frustum", `:real^N->real^N->real->real->real->real^N->bool`);
+   ("rcone_eq", `:real^A->real^A->real->real^A->bool`);
+   ("rcone_ge", `:real^A->real^A->real->real^A->bool`);
+   ("rcone_gt", `:real^A->real^A->real->real^A->bool`);
+   ("rconesgn", `:(real->real->bool)->real^A->real^A->real->real^A->bool`);
+   ("delta_x", `:real->real->real->real->real->real->real`);
+   ("conv0", `:(real^A->bool)->real^A->bool`);
+   ("aff_le", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_lt", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_ge", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_gt", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("sgn_le", `:real->bool`); ("sgn_lt", `:real->bool`);
+   ("sgn_ge", `:real->bool`); ("sgn_gt", `:real->bool`);
+   ("affsign", `:(real->bool)->(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("lin_combo", `:(real^N->bool)->(real^N->real)->real^N`);
+   ("pad2d3d", `:real^2->real^3`); ("plane", `:(real^A->bool)->bool`);
+   ("slice", `:num->real->(real^A->bool)->real^B->bool`);
+   ("pushin", `:num->B->B^A->B^C`); ("dropout", `:num->real^N->real^M`);
+   ("real_measure", `:(real->bool)->real`);
+   ("real_measurable", `:(real->bool)->bool`);
+   ("has_real_measure", `:(real->bool)->real->bool`);
+   ("absolutely_real_integrable_on", `:(real->real)->(real->bool)->bool`);
+   ("real_negligible", `:(real->bool)->bool`);
+   ("real_integral", `:(real->bool)->(real->real)->real`);
+   ("real_integrable_on", `:(real->real)->(real->bool)->bool`);
+   ("has_real_integral", `:(real->real)->real->(real->bool)->bool`);
+   ("closed_real_interval", `:(real#real)list->real->bool`);
+   ("open_real_interval", `:real#real->real->bool`);
+   ("is_realinterval", `:(real->bool)->bool`);
+   ("real_differentiable_on", `:(real->real)->(real->bool)->bool`);
+   ("higher_real_derivative", `:num->(real->real)->real->real`);
+   ("real_derivative", `:(real->real)->real->real`);
+   ("real_differentiable", `:(real->real)->(real)net->bool`);
+   ("has_real_derivative", `:(real->real)->real->(real)net->bool`);
+   ("real_continuous_on", `:(real->real)->(real->bool)->bool`);
+   ("real_continuous", `:(A->real)->(A)net->bool`);
+   ("at_neginfinity", `:(real)net`); ("at_posinfinity", `:(real)net`);
+   ("atreal", `:real->(real)net`);
+   ("real_summable", `:(num->bool)->(num->real)->bool`);
+   ("real_infsum", `:(num->bool)->(num->real)->real`);
+   ("real_sums", `:(num->real)->real->(num->bool)->bool`);
+   ("--->", `:(A->real)->real->(A)net->bool`);
+   ("real_compact", `:(real->bool)->bool`);
+   ("real_bounded", `:(real->bool)->bool`);
+   ("euclideanreal", `:(real)topology`);
+   ("real_closed", `:(real->bool)->bool`);
+   ("real_open", `:(real->bool)->bool`);
+   ("measure", `:(real^A->bool)->real`);
+   ("measurable", `:(real^A->bool)->bool`);
+   ("has_measure", `:(real^A->bool)->real->bool`);
+   ("*_c", `:(A->bool)->(B->bool)->A#B->bool`);
+   ("+_c", `:(A->bool)->(B->bool)->A+B->bool`);
+   ("ordinal", `:(A#A->bool)->bool`);
+   ("linseg", `:(A#A->bool)->A->A#A->bool`);
+   ("inseg", `:(A#A->bool)->(A#A->bool)->bool`);
+   ("woset", `:(A#A->bool)->bool`);
+   ("chain", `:(A#A->bool)->(A->bool)->bool`);
+   ("poset", `:(A#A->bool)->bool`); ("fl", `:(A#A->bool)->A->bool`);
+   ("less", `:(A#A->bool)->A#A->bool`);
+   ("angle", `:real^A#real^A#real^A->real`);
+   ("vector_angle", `:real^A->real^A->real`); ("acs", `:real->real`);
+   ("asn", `:real->real`); ("cacs", `:real^2->real^2`);
+   ("casn", `:real^2->real^2`); ("atn", `:real->real`);
+   ("catn", `:real^2->real^2`); ("unwinding", `:real^2->real^2`);
+   ("cpow", `:real^2->real^2->real^2`); ("clog", `:real^2->real^2`);
+   ("tan", `:real->real`); ("ctan", `:real^2->real^2`);
+   ("rotate2d", `:real->real^2->real^2`); ("Arg", `:real^2->real`);
+   ("pi", `:real`); ("log", `:real->real`); ("cos", `:real->real`);
+   ("sin", `:real->real`); ("exp", `:real->real`);
+   ("csin", `:real^2->real^2`); ("ccos", `:real^2->real^2`);
+   ("cexp", `:real^2->real^2`);
+   ("analytic_on", `:(real^2->real^2)->(real^2->bool)->bool`);
+   ("holomorphic_on", `:(real^2->real^2)->(real^2->bool)->bool`);
+   ("higher_complex_derivative", `:num->(real^2->real^2)->real^2->real^2`);
+   ("complex_derivative", `:(real^2->real^2)->real^2->real^2`);
+   ("complex_differentiable", `:(real^2->real^2)->(real^2)net->bool`);
+   ("has_complex_derivative", `:(real^2->real^2)->real^2->(real^2)net->bool`);
+   ("cproduct", `:(A->bool)->(A->real^2)->real^2`);
+   ("real", `:real^2->bool`); ("csqrt", `:real^2->real^2`);
+   ("cnj", `:real^2->real^2`); ("complex_pow", `:real^2->num->real^2`);
+   ("complex_div", `:real^2->real^2->real^2`);
+   ("complex_inv", `:real^2->real^2`);
+   ("complex_mul", `:real^2->real^2->real^2`); ("ii", `:real^2`);
+   ("Cx", `:real->real^2`); ("complex", `:real#real->real^2`);
+   ("Im", `:real^2->real`); ("Re", `:real^2->real`);
+   ("absolutely_integrable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("negligible", `:(real^A->bool)->bool`);
+   ("indicator", `:(real^M->bool)->real^M->real^1`);
+   ("division_points",
+    `:(real^N->bool)->((real^N->bool)->bool)->num#real->bool`);
+   ("lifted", `:(A->A->B)->(A)option->(A)option->(B)option`);
+   ("operative", `:(A->A->A)->((real^N->bool)->A)->bool`);
+   ("integral", `:(real^A->bool)->(real^A->real^B)->real^B`);
+   ("integrable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("has_integral", `:(real^B->real^A)->real^A->(real^B->bool)->bool`);
+   ("has_integral_compact_interval",
+    `:(real^B->real^A)->real^A->(real^B->bool)->bool`);
+   ("fine", `:(A->B->bool)->(A#(B->bool)->bool)->bool`);
+   ("tagged_division_of",
+    `:(real^A#(real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("tagged_partial_division_of",
+    `:(real^A#(real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("division_of", `:((real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("gauge", `:(real^A->real^A->bool)->bool`);
+   ("content", `:(real^M->bool)->real`);
+   ("interval_lowerbound", `:(real^M->bool)->real^M`);
+   ("interval_upperbound", `:(real^M->bool)->real^M`);
+   ("vector_derivative", `:(real^1->real^N)->(real^1)net->real^N`);
+   ("has_vector_derivative", `:(real^1->real^A)->real^A->(real^1)net->bool`);
+   ("jacobian", `:(real^A->real^B)->(real^A)net->real^A^B`);
+   ("frechet_derivative", `:(real^A->real^B)->(real^A)net->real^A->real^B`);
+   ("differentiable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("differentiable", `:(real^B->real^A)->(real^B)net->bool`);
+   ("has_derivative",
+    `:(real^B->real^A)->(real^B->real^A)->(real^B)net->bool`);
+   ("interval_bij", `:real^N#real^N->real^N#real^N->real^N->real^N`);
+   ("retract_of", `:(real^A->bool)->(real^A->bool)->bool`);
+   ("retraction", `:(real^N->bool)#(real^N->bool)->(real^N->real^N)->bool`);
+   ("reduced", `:((num->num)->num->num)->num->(num->num)->num`);
+   ("ksimplex", `:num->num->((num->num)->bool)->bool`);
+   ("kle", `:num->(num->num)->(num->num)->bool`);
+   ("path_connected", `:(real^A->bool)->bool`);
+   ("path_component", `:(real^A->bool)->real^A->real^A->bool`);
+   ("linepath", `:real^A#real^A->real^1->real^A`);
+   ("shiftpath", `:real^1->(real^1->real^N)->real^1->real^N`);
+   ("arc", `:(real^1->real^N)->bool`);
+   ("simple_path", `:(real^1->real^N)->bool`);
+   ("++", `:(real^1->A)->(real^1->A)->real^1->A`);
+   ("reversepath", `:(real^1->real^N)->real^1->real^N`);
+   ("path_image", `:(real^1->real^N)->real^N->bool`);
+   ("pathfinish", `:(real^1->real^N)->real^N`);
+   ("pathstart", `:(real^1->real^N)->real^N`);
+   ("path", `:(real^1->real^N)->bool`);
+   ("extreme_point_of", `:real^A->(real^A->bool)->bool`);
+   ("face_of", `:(real^A->bool)->(real^A->bool)->bool`);
+   ("relative_interior", `:(real^A->bool)->real^A->bool`);
+   ("starlike", `:(real^A->bool)->bool`);
+   ("epigraph",
+    `:(real^N->bool)->(real^N->real)->real^(N,1)finite_sum->bool`);
+   ("convex_on", `:(real^A->real)->(real^A->bool)->bool`);
+   ("coplanar", `:(real^A->bool)->bool`);
+   ("affine_dependent", `:(real^N->bool)->bool`);
+   ("conic", `:(real^A->bool)->bool`); ("convex", `:(real^A->bool)->bool`);
+   ("affine", `:(real^A->bool)->bool`);
+   ("closest_point", `:(real^A->bool)->real^A->real^A`);
+   ("from", `:num->num->bool`);
+   ("summable", `:(num->bool)->(num->real^A)->bool`);
+   ("infsum", `:(num->bool)->(num->real^A)->real^A`);
+   ("sums", `:(num->real^A)->real^A->(num->bool)->bool`);
+   ("homeomorphic", `:(real^A->bool)->(real^B->bool)->bool`);
+   ("homeomorphism",
+    `:(real^B->bool)#(real^A->bool)->(real^B->real^A)#(real^A->real^B)->bool`);
+   ("open_segment", `:real^A#real^A->real^A->bool`);
+   ("closed_segment", `:(real^A#real^A)list->real^A->bool`);
+   ("is_interval", `:(real^N->bool)->bool`);
+   ("closed_interval", `:(real^N#real^N)list->real^N->bool`);
+   ("open_interval", `:real^N#real^N->real^N->bool`);
+   ("diameter", `:(real^A->bool)->real`);
+   ("connected_component", `:(real^A->bool)->real^A->real^A->bool`);
+   ("uniformly_continuous_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("continuous_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("continuous", `:(B->real^A)->(B)net->bool`);
+   ("complete", `:(real^N->bool)->bool`); ("cauchy", `:(num->real^N)->bool`);
+   ("compact", `:(real^N->bool)->bool`);
+   ("bounded", `:(real^N->bool)->bool`); ("netlimit", `:(A)net->A`);
+   ("lim", `:(A)net->(A->real^B)->real^B`);
+   ("-->", `:(B->real^A)->real^A->(B)net->bool`);
+   ("eventually", `:(A->bool)->(A)net->bool`);
+   ("trivial_limit", `:(A)net->bool`);
+   ("in_direction", `:real^A->real^A->(real^A)net`);
+   ("within", `:(A)net->(A->bool)->(A)net`); ("sequentially", `:(num)net`);
+   ("at_infinity", `:(real^A)net`); ("at", `:real^A->(real^A)net`);
+   ("netord", `:(A)net->A->A->bool`); ("mk_net", `:(A->A->bool)->(A)net`);
+   ("frontier", `:(real^A->bool)->real^A->bool`);
+   ("closure", `:(real^A->bool)->real^A->bool`);
+   ("interior", `:(real^A->bool)->real^A->bool`);
+   ("limit_point_of", `:real^A->(real^A->bool)->bool`);
+   ("connected", `:(real^A->bool)->bool`);
+   ("cball", `:real^A#real->real^A->bool`);
+   ("ball", `:real^A#real->real^A->bool`);
+   ("euclidean", `:(real^A)topology`); ("closed", `:(real^N->bool)->bool`);
+   ("open", `:(real^A->bool)->bool`);
+   ("subtopology", `:(A)topology->(A->bool)->(A)topology`);
+   ("closed_in", `:(A)topology->(A->bool)->bool`);
+   ("topspace", `:(A)topology->A->bool`);
+   ("open_in", `:(A)topology->(A->bool)->bool`);
+   ("topology", `:((A->bool)->bool)->(A)topology`);
+   ("istopology", `:((A->bool)->bool)->bool`);
+   ("ITER", `:num->(A->A)->A->A`); ("frac", `:real->real`);
+   ("floor", `:real->real`); ("integer", `:real->bool`);
+   ("cross", `:real^3->real^3->real^3`);
+   ("rotoinversion_matrix", `:real^A^A->bool`);
+   ("rotation_matrix", `:real^A^A->bool`);
+   ("orthogonal_matrix", `:real^N^N->bool`);
+   ("orthogonal_transformation", `:(real^N->real^N)->bool`);
+   ("det", `:real^N^N->real`); ("trace", `:real^N^N->real`);
+   ("product", `:(A->bool)->(A->real)->real`); ("sign", `:(A->A)->real`);
+   ("evenperm", `:(A->A)->bool`); ("permutation", `:(A->A)->bool`);
+   ("swapseq", `:num->(A->A)->bool`); ("swap", `:A#A->A->A`);
+   ("inverse", `:(B->A)->A->B`); ("permutes", `:(A->A)->(A->bool)->bool`);
+   ("midpoint", `:real^A#real^A->real^A`);
+   ("between", `:real^A->real^A#real^A->bool`);
+   ("collinear", `:(real^A->bool)->bool`); ("infnorm", `:real^N->real`);
+   ("rank", `:real^M^N->num`); ("columnvector", `:real^N->real^1^N`);
+   ("rowvector", `:real^N->real^N^1`); ("dim", `:(real^A->bool)->num`);
+   ("independent", `:(real^A->bool)->bool`);
+   ("dependent", `:(real^A->bool)->bool`);
+   ("span", `:(real^A->bool)->real^A->bool`);
+   ("subspace", `:(real^A->bool)->bool`); ("drop", `:real^1->real`);
+   ("lift", `:real->real^1`); ("onorm", `:(real^M->real^N)->real`);
+   ("matrix", `:(real^M->real^N)->real^M^N`);
+   ("matrix_inv", `:real^N^M->real^M^N`); ("invertible", `:real^N^M->bool`);
+   ("columns", `:real^N^M->real^M->bool`);
+   ("rows", `:real^N^M->real^N->bool`); ("column", `:num->real^N^M->real^M`);
+   ("row", `:num->real^N^M->real^N`); ("transp", `:real^N^M->real^M^N`);
+   ("mat", `:num->real^N^M`);
+   ("vector_matrix_mul", `:real^M->real^N^M->real^N`);
+   ("matrix_vector_mul", `:real^N^M->real^N->real^M`);
+   ("matrix_mul", `:real^N^M->real^P^N->real^P^M`);
+   ("matrix_sub", `:real^N^M->real^N^M->real^N^M`);
+   ("matrix_add", `:real^N^M->real^N^M->real^N^M`);
+   ("matrix_neg", `:real^N^M->real^N^M`);
+   ("adjoint", `:(real^M->real^N)->real^N->real^M`);
+   ("bilinear", `:(real^A->real^B->real^C)->bool`);
+   ("linear", `:(real^M->real^N)->bool`);
+   ("orthogonal", `:real^A->real^A->bool`); ("basis", `:num->real^A`);
+   ("vsum", `:(A->bool)->(A->real^N)->real^N`);
+   ("distance", `:real^A#real^A->real`); ("vector_norm", `:real^A->real`);
+   ("dot", `:real^N->real^N->real`); ("vec", `:num->real^N`);
+   ("%", `:real->real^N->real^N`); ("vector_neg", `:real^N->real^N`);
+   ("vector_sub", `:real^N->real^N->real^N`);
+   ("vector_add", `:real^N->real^N->real^N`); ("sqrt", `:real->real`);
+   ("hull", `:((A->bool)->bool)->(A->bool)->A->bool`);
+   ("inf", `:(real->bool)->real`); ("sup", `:(real->bool)->real`);
+   ("superadmissible",
+    `:(A->A->bool)->((A->C)->B->bool)->(B->A)->((A->C)->B->C)->bool`);
+   ("tailadmissible",
+    `:(A->A->bool)->((A->B)->P->bool)->(P->A)->((A->B)->P->B)->bool`);
+   ("admissible",
+    `:(B->A->bool)->((B->C)->D->bool)->(D->A)->((B->C)->D->E)->bool`);
+   ("CASEWISE", `:((A->C)#(B->A->D))list->B->C->D`);
+   ("vector", `:(A)list->A^N`);
+   ("dest_auto_define_finite_type_3", `:3->num`);
+   ("mk_auto_define_finite_type_3", `:num->3`);
+   ("dest_auto_define_finite_type_2", `:2->num`);
+   ("mk_auto_define_finite_type_2", `:num->2`);
+   ("sndcart", `:A^(M,N)finite_sum->A^N`);
+   ("fstcart", `:A^(M,N)finite_sum->A^M`);
+   ("pastecart", `:A^M->A^N->A^(M,N)finite_sum`);
+   ("dest_finite_sum", `:(A,B)finite_sum->num`);
+   ("mk_finite_sum", `:num->(A,B)finite_sum`); ("lambda", `:(num->A)->A^B`);
+   ("$", `:B^A->num->B`); ("dest_cart", `:A^B->(B)finite_image->A`);
+   ("mk_cart", `:((B)finite_image->A)->A^B`);
+   ("dest_finite_image", `:(A)finite_image->num`);
+   ("finite_index", `:num->(A)finite_image`);
+   ("dimindex", `:(A->bool)->num`); ("sum", `:(A->bool)->(A->real)->real`);
+   ("nsum", `:(A->bool)->(A->num)->num`);
+   ("iterate", `:(B->B->B)->(A->bool)->(A->B)->B`);
+   ("support", `:(B->B->B)->(A->B)->(A->bool)->A->bool`);
+   ("monoidal", `:(A->A->A)->bool`); ("neutral", `:(A->A->A)->A`);
+   ("..", `:num->num->num->bool`); ("COUNTABLE", `:(A->bool)->bool`);
+   (">_c", `:(A->bool)->(B->bool)->bool`);
+   (">=_c", `:(A->bool)->(B->bool)->bool`);
+   ("=_c", `:(A->bool)->(B->bool)->bool`);
+   ("<_c", `:(A->bool)->(B->bool)->bool`);
+   ("<=_c", `:(A->bool)->(B->bool)->bool`);
+   ("PAIRWISE", `:(A->A->bool)->(A)list->bool`);
+   ("pairwise", `:(A->A->bool)->(A->bool)->bool`);
+   ("list_of_set", `:(A->bool)->(A)list`);
+   ("set_of_list", `:(A)list->A->bool`);
+   ("CROSS", `:(A->bool)->(B->bool)->A#B->bool`);
+   ("HAS_SIZE", `:(A->bool)->num->bool`); ("CARD", `:(A->bool)->num`);
+   ("ITSET", `:(A->B->B)->(A->bool)->B->B`);
+   ("FINREC", `:(A->B->B)->B->(A->bool)->B->num->bool`);
+   ("REST", `:(A->bool)->A->bool`); ("CHOICE", `:(A->bool)->A`);
+   ("BIJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("SURJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("INJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("IMAGE", `:(A->B)->(A->bool)->B->bool`);
+   ("INFINITE", `:(A->bool)->bool`); ("FINITE", `:(A->bool)->bool`);
+   ("SING", `:(A->bool)->bool`); ("DISJOINT", `:(A->bool)->(A->bool)->bool`);
+   ("PSUBSET", `:(A->bool)->(A->bool)->bool`);
+   ("SUBSET", `:(A->bool)->(A->bool)->bool`);
+   ("DELETE", `:(A->bool)->A->A->bool`);
+   ("DIFF", `:(A->bool)->(A->bool)->A->bool`);
+   ("INTERS", `:((A->bool)->bool)->A->bool`);
+   ("INTER", `:(A->bool)->(A->bool)->A->bool`);
+   ("UNIONS", `:((A->bool)->bool)->A->bool`);
+   ("UNION", `:(A->bool)->(A->bool)->A->bool`); ("UNIV", `:A->bool`);
+   ("INSERT", `:A->(A->bool)->A->bool`); ("EMPTY", `:A->bool`);
+   ("SETSPEC", `:A->bool->A->bool`); ("GSPEC", `:(A->bool)->A->bool`);
+   ("IN", `:A->(A->bool)->bool`); ("num_gcd", `:num#num->num`);
+   ("num_coprime", `:num#num->bool`); ("num_mod", `:num->num->num->bool`);
+   ("num_divides", `:num->num->bool`); ("num_of_int", `:int->num`);
+   ("int_gcd", `:int#int->int`); ("int_coprime", `:int#int->bool`);
+   ("int_mod", `:int->int->int->bool`); ("int_divides", `:int->int->bool`);
+   ("real_mod", `:real->real->real->bool`);
+   ("==", `:A->A->(A->A->bool)->bool`); ("rem", `:int->int->int`);
+   ("div", `:int->int->int`); ("int_pow", `:int->num->int`);
+   ("int_min", `:int->int->int`); ("int_max", `:int->int->int`);
+   ("int_abs", `:int->int`); ("int_mul", `:int->int->int`);
+   ("int_sub", `:int->int->int`); ("int_add", `:int->int->int`);
+   ("int_neg", `:int->int`); ("int_of_num", `:num->int`);
+   ("int_gt", `:int->int->bool`); ("int_ge", `:int->int->bool`);
+   ("int_lt", `:int->int->bool`); ("int_le", `:int->int->bool`);
+   ("real_of_int", `:int->real`); ("int_of_real", `:real->int`);
+   ("is_int", `:real->bool`); ("DECIMAL", `:num->num->real`);
+   ("real_min", `:real->real->real`); ("real_max", `:real->real->real`);
+   ("real_div", `:real->real->real`); ("real_pow", `:real->num->real`);
+   ("real_abs", `:real->real`); ("real_gt", `:real->real->bool`);
+   ("real_ge", `:real->real->bool`); ("real_lt", `:real->real->bool`);
+   ("real_sub", `:real->real->real`); ("real_inv", `:real->real`);
+   ("real_le", `:real->real->bool`); ("real_mul", `:real->real->real`);
+   ("real_add", `:real->real->real`); ("real_neg", `:real->real`);
+   ("real_of_num", `:num->real`); ("dest_real", `:real->hreal#hreal->bool`);
+   ("mk_real", `:(hreal#hreal->bool)->real`);
+   ("treal_eq", `:hreal#hreal->hreal#hreal->bool`);
+   ("treal_inv", `:hreal#hreal->hreal#hreal`);
+   ("treal_le", `:hreal#hreal->hreal#hreal->bool`);
+   ("treal_mul", `:hreal#hreal->hreal#hreal->hreal#hreal`);
+   ("treal_add", `:hreal#hreal->hreal#hreal->hreal#hreal`);
+   ("treal_neg", `:hreal#hreal->hreal#hreal`);
+   ("treal_of_num", `:num->hreal#hreal`); ("hreal_inv", `:hreal->hreal`);
+   ("hreal_le", `:hreal->hreal->bool`);
+   ("hreal_mul", `:hreal->hreal->hreal`);
+   ("hreal_add", `:hreal->hreal->hreal`); ("hreal_of_num", `:num->hreal`);
+   ("dest_hreal", `:hreal->nadd->bool`);
+   ("mk_hreal", `:(nadd->bool)->hreal`); ("nadd_inv", `:nadd->nadd`);
+   ("nadd_rinv", `:nadd->num->num`); ("nadd_mul", `:nadd->nadd->nadd`);
+   ("nadd_add", `:nadd->nadd->nadd`); ("nadd_le", `:nadd->nadd->bool`);
+   ("nadd_of_num", `:num->nadd`); ("nadd_eq", `:nadd->nadd->bool`);
+   ("dest_nadd", `:nadd->num->num`); ("mk_nadd", `:(num->num)->nadd`);
+   ("is_nadd", `:(num->num)->bool`); ("dist", `:num#num->num`);
+   ("ASCII", `:bool->bool->bool->bool->bool->bool->bool->bool->char`);
+   ("_16756", `:bool->bool->bool->bool->bool->bool->bool->bool->char`);
+   ("_dest_char", `:char->(bool#bool#bool#bool#bool#bool#bool#bool)recspace`);
+   ("_mk_char", `:(bool#bool#bool#bool#bool#bool#bool#bool)recspace->char`);
+   ("ZIP", `:(A)list->(B)list->(A#B)list`);
+   ("ITLIST2", `:(A->B->C->C)->(A)list->(B)list->C->C`);
+   ("ASSOC", `:A->(A#B)list->B`); ("FILTER", `:(A->bool)->(A)list->(A)list`);
+   ("EL", `:num->(A)list->A`);
+   ("MAP2", `:(A->B->C)->(A)list->(B)list->(C)list`);
+   ("ALL2", `:(A->B->bool)->(A)list->(B)list->bool`);
+   ("MEM", `:A->(A)list->bool`); ("ITLIST", `:(A->B->B)->(A)list->B->B`);
+   ("EX", `:(A->bool)->(A)list->bool`); ("ALL", `:(A->bool)->(A)list->bool`);
+   ("NULL", `:(A)list->bool`); ("REPLICATE", `:num->A->(A)list`);
+   ("LAST", `:(A)list->A`); ("MAP", `:(A->B)->(A)list->(B)list`);
+   ("LENGTH", `:(A)list->num`); ("REVERSE", `:(A)list->(A)list`);
+   ("APPEND", `:(A)list->(A)list->(A)list`); ("TL", `:(A)list->(A)list`);
+   ("HD", `:(A)list->A`); ("ISO", `:(A->B)->(B->A)->bool`);
+   ("CONS", `:A->(A)list->(A)list`); ("NIL", `:(A)list`);
+   ("_dest_list", `:(A)list->(A)recspace`);
+   ("_mk_list", `:(A)recspace->(A)list`); ("SOME", `:A->(A)option`);
+   ("NONE", `:(A)option`); ("_dest_option", `:(A)option->(A)recspace`);
+   ("_mk_option", `:(A)recspace->(A)option`); ("OUTR", `:A+B->B`);
+   ("OUTL", `:A+B->A`); ("INR", `:B->A+B`); ("INL", `:A->A+B`);
+   ("_dest_sum", `:A+B->(A#B)recspace`); ("_mk_sum", `:(A#B)recspace->A+B`);
+   ("FNIL", `:num->A`); ("FCONS", `:A->(num->A)->num->A`);
+   ("CONSTR", `:num->A->(num->(A)recspace)->(A)recspace`);
+   ("BOTTOM", `:(A)recspace`); ("_dest_rec", `:(A)recspace->num->A->bool`);
+   ("_mk_rec", `:(num->A->bool)->(A)recspace`);
+   ("ZRECSPACE", `:(num->A->bool)->bool`); ("ZBOT", `:num->A->bool`);
+   ("ZCONSTR", `:num->A->(num->num->A->bool)->num->A->bool`);
+   ("INJP", `:(num->A->bool)->(num->A->bool)->num->A->bool`);
+   ("INJF", `:(num->num->A->bool)->num->A->bool`);
+   ("INJA", `:A->num->A->bool`); ("INJN", `:num->num->A->bool`);
+   ("NUMRIGHT", `:num->num`); ("NUMLEFT", `:num->bool`);
+   ("NUMSUM", `:bool->num->num`); ("NUMSND", `:num->num`);
+   ("NUMFST", `:num->num`); ("NUMPAIR", `:num->num->num`);
+   ("MEASURE", `:(A->num)->A->A->bool`); ("WF", `:(A->A->bool)->bool`);
+   ("minimal", `:(num->bool)->num`); ("MIN", `:num->num->num`);
+   ("MAX", `:num->num->num`); ("MOD", `:num->num->num`);
+   ("DIV", `:num->num->num`); ("FACT", `:num->num`); ("-", `:num->num->num`);
+   ("ODD", `:num->bool`); ("EVEN", `:num->bool`); (">", `:num->num->bool`);
+   (">=", `:num->num->bool`); ("<", `:num->num->bool`);
+   ("<=", `:num->num->bool`); ("EXP", `:num->num->num`);
+   ("*", `:num->num->num`); ("BIT1", `:num->num`); ("BIT0", `:num->num`);
+   ("+", `:num->num->num`); ("PRE", `:num->num`); ("NUMERAL", `:num->num`);
+   ("SUC", `:num->num`); ("_0", `:num`); ("dest_num", `:num->ind`);
+   ("mk_num", `:ind->num`); ("NUM_REP", `:ind->bool`); ("IND_0", `:ind`);
+   ("IND_SUC", `:ind->ind`); ("ONTO", `:(A->B)->bool`);
+   ("ONE_ONE", `:(A->B)->bool`); ("PASSOC", `:((A#B)#C->D)->A#B#C->D`);
+   ("UNCURRY", `:(A->B->C)->A#B->C`); ("CURRY", `:(A#B->C)->A->B->C`);
+   ("SND", `:A#B->B`); ("FST", `:A#B->A`); (",", `:A->B->A#B`);
+   ("REP_prod", `:A#B->A->B->bool`); ("ABS_prod", `:(A->B->bool)->A#B`);
+   ("mk_pair", `:A->B->A->B->bool`); ("_FUNCTION", `:(A->B->bool)->A->B`);
+   ("_MATCH", `:A->(A->B->bool)->B`);
+   ("_GUARDED_PATTERN", `:bool->bool->bool->bool`);
+   ("_UNGUARDED_PATTERN", `:bool->bool->bool`);
+   ("_SEQPATTERN", `:(A->B->bool)->(A->B->bool)->A->B->bool`);
+   ("GEQ", `:A->A->bool`); ("GABS", `:(A->bool)->A`); ("LET_END", `:A->A`);
+   ("LET", `:(A->B)->A->B`); ("one", `:1`); ("one_REP", `:1->bool`);
+   ("one_ABS", `:bool->1`); ("I", `:A->A`); ("o", `:(B->C)->(A->B)->A->C`);
+   ("COND", `:bool->A->A->A`); ("@", `:(A->bool)->A`);
+   ("_FALSITY_", `:bool`); ("?!", `:(A->bool)->bool`); ("~", `:bool->bool`);
+   ("F", `:bool`); ("\\/", `:bool->bool->bool`); ("?", `:(A->bool)->bool`);
+   ("!", `:(A->bool)->bool`); ("==>", `:bool->bool->bool`);
+   ("/\\", `:bool->bool->bool`); ("T", `:bool`); ("=", `:A->A->bool`)];;
+  let the_loaded_files = 
+      ["flyspeck_utility.hl"; "update_database_310.ml"; "hypermap.hl"; "vol1.hl";
+   "trigonometry.hl"; "database2194fe.ml"; "flyspeck_utility.hl"; "trig2.hl";
+   "trig1.hl"; "ineqdata3q1h.hl"; "ineq.hl"; "enclosed_def.hl";
+   "quadratic_root_plus_def.hl"; "abc_of_quadratic_def.hl"; "muR_def.hl";
+   "collect_geom.hl"; "cayleyR_def.hl"; "affprops.hl"; "AFF_SGN_TAC.hl";
+   "geomdetail.hl"; "snapshot.hl"; "snapshot.hl"; "snapshot.hl";
+   "snapshot.hl"; "snapshot.hl"; "sphere.hl"; "prove_by_refinement.hl";
+   "update_database_310.ml"; "database3be71a.ml"; "snapshot.hl";
+   "print-types.ml"; "flyspeck.ml"; "wlog_examples.ml"; "wlog.ml"; "real.ml";
+   "measure.ml"; "card.ml"; "wo.ml"; "geom.ml"; "transc.ml"; "canal.ml";
+   "complex.ml"; "integration.ml"; "analysis.ml"; "dimension.ml";
+   "convex.ml"; "topology.ml"; "iter.ml"; "floor.ml"; "cross.ml";
+   "determinants.ml"; "products.ml"; "permutations.ml"; "vectors.ml";
+   "misc.ml"; "database.ml"; "help.ml"; "define.ml"; "cart.ml"; "iter.ml";
+   "sets.ml"; "int.ml"; "calc_rat.ml"; "real.ml"; "realarith.ml";
+   "calc_int.ml"; "realax.ml"; "list.ml"; "ind-types.ml"; "grobner.ml";
+   "normalizer.ml"; "calc_num.ml"; "wf.ml"; "arith.ml"; "num.ml"; "pair.ml";
+   "recursion.ml"; "quot.ml"; "meson.ml"; "canon.ml"; "trivia.ml";
+   "class.ml"; "ind-defs.ml"; "theorems.ml"; "simp.ml"; "itab.ml";
+   "tactics.ml"; "drule.ml"; "bool.ml"; "equal.ml"; "printer.ml";
+   "parser.ml"; "preterm.ml"; "nets.ml"; "basics.ml"; "fusion.ml"; "lib.ml";
+   "sys.ml"];;
+  let the_types =   [("loop", 1); ("hypermap", 1); ("net", 1); ("topology", 1); ("3", 0);
+   ("2", 0); ("finite_sum", 2); ("cart", 2); ("finite_image", 1); ("int", 0);
+   ("real", 0); ("hreal", 0); ("nadd", 0); ("char", 0); ("list", 1);
+   ("option", 1); ("sum", 2); ("recspace", 1); ("num", 0); ("ind", 0);
+   ("prod", 2); ("1", 0); ("bool", 0); ("fun", 2)];;
+  let the_overload_skeletons = Snapshot_v220_7_31_2009.the_overload_skeletons;;
+  
+end;;
diff --git a/development/thales/chaff/general/flyspeck_utility.hl b/development/thales/chaff/general/flyspeck_utility.hl
new file mode 100644 (file)
index 0000000..b562b48
--- /dev/null
@@ -0,0 +1,70 @@
+(* ========================================================================== *)
+(* FLYSPECK - BOOK FORMALIZATION                                              *)
+(*                                                                            *)
+(* Chapter: leg                                                               *)
+(* Author: Thomas C. Hales                                                    *)
+(* Date: 2010-02-10                                                           *)
+(* ========================================================================== *)
+
+(* 
+General utilities.
+
+*)
+
+
+
+module type Flyspeck_utility_type = sig
+
+(* looks up all constants first defined in a given file.
+    The file should be specified in the same way as the "flyspeck_needs" statement 
+    Also, the first argument is filetable() from build.hl
+*)
+
+val constants_by_file : (string * int) list -> string -> (string * hol_type) list
+
+(* inverse lookup *)
+
+val file_of_constant : (string * int) list -> string -> string
+
+
+end;;
+
+
+module Flyspeck_utility  :Flyspeck_utility_type = struct
+
+
+
+(* track constants by file *)
+  let rec findpos c a  = function
+      [] -> failwith "find"
+    | b::bs -> if Pervasives.compare a b = 0 then c else findpos (c+1) a bs;;
+
+let rec sublist t a b = match t with
+   [] -> []
+  | t0::ts -> if (a>0) then sublist ts (a-1) (b-1) else if (b<=0) then [] else t0::sublist ts 0 (b-1);;
+
+let range_by_table c (m:(string*int)list) (s:string) = 
+  try(
+    let r = assoc s m in
+    let i = findpos 0 (s,r) m in
+    let start = if (i<=0) then 0 else (let (_,j) = List.nth m (i-1) in j) in
+      sublist c start r)
+  with Failure "find" -> [];;
+
+let rec rev_assoc_sorted t i = match t with
+   [] -> failwith "find"
+  | (x,j)::ts -> if (i>=j) then rev_assoc_sorted ts i else x;;
+
+
+let constants_by_file   = fun (ftable:(string*int)list) s -> range_by_table (List.rev (constants())) ftable s;;
+
+(* Example: constants_by_file "trigonometry/trig1.hl" *)
+
+let file_of_constant ftable s = 
+   let cs = map fst (List.rev (constants())) in
+   try (let i = findpos 0 s cs in rev_assoc_sorted (List.rev ftable) i)
+   with Failure "find" -> "Constant not located";;
+
+(* Example: file_of_constant ftable "packing" *)
+
+end;;
diff --git a/development/thales/chaff/general/generate_definitions.ml b/development/thales/chaff/general/generate_definitions.ml
new file mode 100644 (file)
index 0000000..2eacc89
--- /dev/null
@@ -0,0 +1,78 @@
+(* ------------------------------------------------------------------ *)
+(*   Generate Definition files from the Collection in Elementary Geometry           *)
+(* ------------------------------------------------------------------ *)
+
+open Template_hol;;
+
+(* let _ = set_root_dir "/flyspeck_google/source/text_formalization";; *)
+
+let cayleyRstr="new_definition `cayleyR x12 x13 x14 x15  x23 x24 x25  x34 x35 x45 = 
+  -- (x14*x14*x23*x23) + &2 *x14*x15*x23*x23 - x15*x15*x23*x23 + &2 *x13*x14*x23*x24 - &2 *x13*x15*x23*x24 - &2 *x14*x15*x23*x24 + 
+   &2 *x15*x15*x23*x24 - x13*x13*x24*x24 + &2 *x13*x15*x24*x24 - x15*x15*x24*x24 - &2 *x13*x14*x23*x25 + 
+   &2 *x14*x14*x23*x25 + &2 *x13*x15*x23*x25 - &2 *x14*x15*x23*x25 + &2 *x13*x13*x24*x25 - &2 *x13*x14*x24*x25 - &2 *x13*x15*x24*x25 + 
+   &2 *x14*x15*x24*x25 - x13*x13*x25*x25 + &2 *x13*x14*x25*x25 - x14*x14*x25*x25 + &2 *x12*x14*x23*x34 - &2 *x12*x15*x23*x34 - 
+   &2 *x14*x15*x23*x34 + &2 *x15*x15*x23*x34 + &2 *x12*x13*x24*x34 - &2 *x12*x15*x24*x34 - &2 *x13*x15*x24*x34 + &2 *x15*x15*x24*x34 + 
+   &4 *x15*x23*x24*x34 - &2 *x12*x13*x25*x34 - &2 *x12*x14*x25*x34 + &4 *x13*x14*x25*x34 + &4 *x12*x15*x25*x34 - &2 *x13*x15*x25*x34 - &2 *x14*x15*x25*x34 - 
+   &2 *x14*x23*x25*x34 - &2 *x15*x23*x25*x34 - &2 *x13*x24*x25*x34 - &2 *x15*x24*x25*x34 + &2 *x13*x25*x25*x34 + &2 *x14*x25*x25*x34 - 
+   x12*x12*x34*x34 + &2 *x12*x15*x34*x34 - x15*x15*x34*x34 + &2 *x12*x25*x34*x34 + &2 *x15*x25*x34*x34 - 
+   x25*x25*x34*x34 - &2 *x12*x14*x23*x35 + &2 *x14*x14*x23*x35 + &2 *x12*x15*x23*x35 - &2 *x14*x15*x23*x35 - &2 *x12*x13*x24*x35 + 
+   &4 *x12*x14*x24*x35 - &2 *x13*x14*x24*x35 - &2 *x12*x15*x24*x35 + &4 *x13*x15*x24*x35 - &2 *x14*x15*x24*x35 - &2 *x14*x23*x24*x35 - &2 *x15*x23*x24*x35 + 
+   &2 *x13*x24*x24*x35 + &2 *x15*x24*x24*x35 + &2 *x12*x13*x25*x35 - &2 *x12*x14*x25*x35 - &2 *x13*x14*x25*x35 + &2 *x14*x14*x25*x35 + 
+   &4 *x14*x23*x25*x35 - &2 *x13*x24*x25*x35 - &2 *x14*x24*x25*x35 + &2 *x12*x12*x34*x35 - &2 *x12*x14*x34*x35 - &2 *x12*x15*x34*x35 + 
+   &2 *x14*x15*x34*x35 - &2 *x12*x24*x34*x35 - &2 *x15*x24*x34*x35 - &2 *x12*x25*x34*x35 - &2 *x14*x25*x34*x35 + &2 *x24*x25*x34*x35 - 
+   x12*x12*x35*x35 + &2 *x12*x14*x35*x35 - x14*x14*x35*x35 + &2 *x12*x24*x35*x35 + &2 *x14*x24*x35*x35 - 
+   x24*x24*x35*x35 + &4 *x12*x13*x23*x45 - &2 *x12*x14*x23*x45 - &2 *x13*x14*x23*x45 - &2 *x12*x15*x23*x45 - &2 *x13*x15*x23*x45 + 
+   &4 *x14*x15*x23*x45 + &2 *x14*x23*x23*x45 + &2 *x15*x23*x23*x45 - &2 *x12*x13*x24*x45 + &2 *x13*x13*x24*x45 + &2 *x12*x15*x24*x45 - 
+   &2 *x13*x15*x24*x45 - &2 *x13*x23*x24*x45 - &2 *x15*x23*x24*x45 - &2 *x12*x13*x25*x45 + &2 *x13*x13*x25*x45 + &2 *x12*x14*x25*x45 - 
+   &2 *x13*x14*x25*x45 - &2 *x13*x23*x25*x45 - &2 *x14*x23*x25*x45 + &4 *x13*x24*x25*x45 + &2 *x12*x12*x34*x45 - &2 *x12*x13*x34*x45 - 
+   &2 *x12*x15*x34*x45 + &2 *x13*x15*x34*x45 - &2 *x12*x23*x34*x45 - &2 *x15*x23*x34*x45 - &2 *x12*x25*x34*x45 - &2 *x13*x25*x34*x45 + &2 *x23*x25*x34*x45 + 
+   &2 *x12*x12*x35*x45 - &2 *x12*x13*x35*x45 - &2 *x12*x14*x35*x45 + &2 *x13*x14*x35*x45 - &2 *x12*x23*x35*x45 - &2 *x14*x23*x35*x45 - 
+   &2 *x12*x24*x35*x45 - &2 *x13*x24*x35*x45 + &2 *x23*x24*x35*x45 + &4 *x12*x34*x35*x45 - x12*x12*x45*x45 + &2 *x12*x13*x45*x45 - 
+   x13*x13*x45*x45 + &2 *x12*x23*x45*x45 + &2 *x13*x23*x45*x45 - x23*x23*x45*x45` ";;
+
+let mkd def code comments needlist = 
+  let ud = 
+    {identifier=def;
+     chapter="LEG";
+     author="Thomas C. Hales";
+     date="2010-02-07";
+     code=code;
+     comments=comments;
+     needlist=needlist;
+    } in
+     output_template_def ud;;
+
+mkd "cayleyR" cayleyRstr ["This is the 5 vertex Cayley-Menger determinant";"EDSFZOT";"NUHSVLM";
+       "See http://www.math.pitt.edu/~thales/papers/Lemmas_Elementary_Geometry.pdf";
+   "Properties of cayleyR have been formalized by Nguyen Quang Truong"]
+     [];;
+
+mkd "quadratic_root_plus"
+   "   new_definition `quadratic_root_plus (a, b, c) = ( -- b + sqrt(b pow 2 - &4 * a * c))/ (&2 * a)`;;"
+   ["Lemmas Elementary Geometry  (def:calE), RPFVZDI"] [];;
+
+mkd "muR"
+  "new_definition `muR y1 y2 y3 y4 y5 y6 y7 y8 y9 x = cayleyR (y6*y6) (y5*y5) (y1*y1) (y7*y7) (y4*y4) (y2*y2) (y8*y8)  (y3*y3) (y9*y9) x`;;"
+  [
+   "This is the cayleyR function, expressed in terms of the unsquared variables";
+   "indexing: five vertices v1..v5, yij runs from vi to vj,";
+   "two tetrahedra, shared face v1,v2,v3.";
+   "v4 v5 in opposite half-planes.";
+   "enclosed = y45 = sqrt(x45) is the distance from v4 to v5.";
+   "[y1,y2,y3,y4,y5,y6,y7,y8,y9]=[y14,y24,y34,y23,y13,y12,y15,y25,y35].";
+   "y1..y6 is the usual indexing of a simplex.";
+   "y4..y9 is mod 6 congruent to the usual indexing."] ["leg/cayleyR_def.hl"];;
+
+mkd "abc_of_quadratic"
+ "new_definition `abc_of_quadratic f = 
+  let c = f (&0) in
+  let  p = f (&1) in
+  let n = f (-- &1) in
+  ((p + n)/(&2) - c, (p -n)/(&2), c)` ;;" ["f = \\x. a x^2 + b x + c, extract a b c"] [];;
+
+mkd "enclosed"
+ "new_definition `enclosed y1 y2 y3 y4 y5 y6 y7 y8 y9 = sqrt 
+  (quadratic_root_plus (abc_of_quadratic (muR y1 y2 y3 y4 y5 y6 y7 y8 y9)))`;;"
+  ["The function of 9 variables defined on page 37 of the Kepler Conjecture, DCG vol 36(1), July 2006";
+   "It is generally typeset as a calligraphic E"] ["leg/muR_def.hl";"leg/abc_of_quadratic_def.hl";"leg/quadratic_root_plus.hl"];;
+
diff --git a/development/thales/chaff/general/log.hl b/development/thales/chaff/general/log.hl
new file mode 100644 (file)
index 0000000..f99c12c
--- /dev/null
@@ -0,0 +1,36 @@
+
+module Log = struct
+
+type t = {
+  date: string; (* "yearXXXX/monthXX/dayXX" *)
+  hol_version: string;
+  hol_snapshot: string; (* yearXXmonthXXdayXX *)
+  svn_version: int;  (* from http://code.google.com/p/flyspeck *)
+  ftable : (string*int) list;
+  comment : string;
+};;
+
+let loglist = [  (* put newest at the beginnning *)
+{
+date = "2010/01/12";
+hol_version="2.20+";
+hol_snapshot="091221";
+svn_version=1531;
+ftable=[("volume/vol1.hl", 750); ("trigonometry/trigonometry.hl", 732);
+   ("trigonometry/trig2.hl", 730); ("trigonometry/trig1.hl", 721);
+   ("nonlinear/ineqdata3q1h.hl", 720); ("nonlinear/ineq.hl", 720);
+   ("leg/enclosed_def.hl", 720); ("leg/quadratic_root_plus_def.hl", 719);
+   ("leg/abc_of_quadratic_def.hl", 718); ("leg/muR_def.hl", 717);
+   ("leg/collect_geom.hl", 716); ("leg/cayleyR_def.hl", 691);
+   ("leg/affprops.hl", 690); ("leg/AFF_SGN_TAC.hl", 690);
+   ("leg/geomdetail.hl", 690); ("general/sphere.hl", 648);
+   ("general/flyspeck_utility.hl", 580);
+   ("general/prove_by_refinement.hl", 580);
+   ("general/update_database_310.ml", 580); ("general/print-types.ml", 580);
+   ("pervasives", 580)];
+ comment = "Thales, office Mac, Virtual Box, Ubuntu, checkpointed, hypermap.hl failed";
+};
+];;
+
+end;;
+
diff --git a/development/thales/chaff/general/snapshot.hl b/development/thales/chaff/general/snapshot.hl
new file mode 100644 (file)
index 0000000..301c5ea
--- /dev/null
@@ -0,0 +1,1202 @@
+(* ========================================================================== *)
+(* FLYSPECK - BOOK FORMALIZATION                                              *)
+(*                                                                            *)
+(* Chapter: General                                                 *)
+(* Author: Thomas C. Hales                                                    *)
+(* Date: 2010-02-10                                                           *)
+(* ========================================================================== *)
+
+(* 
+store data from different HOL Light snapshots to make it easier to make
+an upgrade from one snapshot to the next. 
+*)
+
+
+
+module type Snapshot_type = sig
+  val the_constants :  (string * hol_type) list 
+  val the_loaded_files : string list
+  val the_overload_skeletons : (string*hol_type) list
+  val the_interface : (string * (string * hol_type)) list
+  val the_types:(string*int) list
+end;;
+
+module Snapshot_utility = struct
+
+(* This was used to make printable manufactured types.  No more `:?467346` *)
+
+let clean_ty ty = 
+   let fr = (union (tyvars ty) []) in
+   let alpha = map (mk_vartype o (String.make 1) o (char_of_int)) (65--(65+List.length(fr))) in
+   let  alphafr = subtract alpha fr in
+   let sel = filter (fun t ->  (dest_vartype t).[0]='?')  fr in
+   type_subst (map (fun t-> (List.nth alphafr t,List.nth sel t)) (0--(List.length sel - 1))) ty;;
+
+(*
+0;;
+#print_length 10000;;
+map (fun (t,u) -> (t, clean_ty u)) (constants());;
+map fst !loaded_files;;
+!the_overload_skeletons;;
+map (fun (t,(u,v)) -> (t,(u,clean_ty v))) (!the_interface);;
+types();;
+#print_length 500;;
+*)
+
+end;;
+
+
+module Snapshot_v220_7_29_2009 : Snapshot_type = struct
+
+  let the_types =  [("net", 1); ("topology", 1); ("3", 0); ("2", 0); ("finite_sum", 2);
+   ("cart", 2); ("finite_image", 1); ("int", 0); ("real", 0); ("hreal", 0);
+   ("nadd", 0); ("char", 0); ("list", 1); ("option", 1); ("sum", 2);
+   ("recspace", 1); ("num", 0); ("ind", 0); ("prod", 2); ("1", 0);
+   ("bool", 0); ("fun", 2)];;
+
+  let the_loaded_files =  ["flyspeck.ml"; "wlog_examples.ml"; "wlog.ml"; "real.ml"; "measure.ml";
+   "card.ml"; "wo.ml"; "geom.ml"; "transc.ml"; "canal.ml"; "complex.ml";
+   "integration.ml"; "analysis.ml"; "dimension.ml"; "convex.ml";
+   "topology.ml"; "iter.ml"; "floor.ml"; "cross.ml"; "determinants.ml";
+   "products.ml"; "permutations.ml"; "vectors.ml"; "misc.ml"; "database.ml";
+   "help.ml"; "define.ml"; "cart.ml"; "iter.ml"; "sets.ml"; "int.ml";
+   "calc_rat.ml"; "real.ml"; "realarith.ml"; "calc_int.ml"; "realax.ml";
+   "list.ml"; "ind-types.ml"; "grobner.ml"; "normalizer.ml"; "calc_num.ml";
+   "wf.ml"; "arith.ml"; "num.ml"; "pair.ml"; "recursion.ml"; "quot.ml";
+   "meson.ml"; "canon.ml"; "trivia.ml"; "class.ml"; "ind-defs.ml";
+   "theorems.ml"; "simp.ml"; "itab.ml"; "tactics.ml"; "drule.ml"; "bool.ml";
+   "equal.ml"; "printer.ml"; "parser.ml"; "preterm.ml"; "nets.ml";
+   "basics.ml"; "fusion.ml"; "lib.ml"; "sys.ml"];;
+
+  let the_overload_skeletons = 
+    [("real_interval", `:A`); ("segment", `:A`); ("interval", `:A`);
+   ("**", `:A->B->C`); ("norm", `:A->real`); ("gcd", `:A#A->A`);
+   ("coprime", `:A#A->bool`); ("mod", `:A->A->A->bool`);
+   ("divides", `:A->A->bool`); ("&", `:num->A`); ("min", `:A->A->A`);
+   ("max", `:A->A->A`); ("abs", `:A->A`); ("inv", `:A->A`);
+   ("pow", `:A->num->A`); ("--", `:A->A`); (">=", `:A->A->bool`);
+   (">", `:A->A->bool`); ("<=", `:A->A->bool`); ("<", `:A->A->bool`);
+   ("/", `:A->A->A`); ("*", `:A->A->A`); ("-", `:A->A->A`);
+   ("+", `:A->A->A`)];;
+
+(* this should be regenerated. It was not captured at the right moment *)
+  let the_interface =  
+  [("+", ("real_add", `:real->real->real`));
+   ("-", ("real_sub", `:real->real->real`));
+   ("*", ("real_mul", `:real->real->real`));
+   ("/", ("real_div", `:real->real->real`));
+   ("<", ("real_lt", `:real->real->bool`));
+   ("<=", ("real_le", `:real->real->bool`));
+   (">", ("real_gt", `:real->real->bool`));
+   (">=", ("real_ge", `:real->real->bool`));
+   ("--", ("real_neg", `:real->real`));
+   ("pow", ("real_pow", `:real->num->real`));
+   ("inv", ("real_inv", `:real->real`));
+   ("abs", ("real_abs", `:real->real`));
+   ("max", ("real_max", `:real->real->real`));
+   ("min", ("real_min", `:real->real->real`));
+   ("&", ("real_of_num", `:num->real`));
+   ("mod", ("real_mod", `:real->real->real->bool`));
+   ("+", ("+", `:num->num->num`)); ("-", ("-", `:num->num->num`));
+   ("*", ("*", `:num->num->num`)); ("<", ("<", `:num->num->bool`));
+   ("<=", ("<=", `:num->num->bool`)); (">", (">", `:num->num->bool`));
+   (">=", (">=", `:num->num->bool`));
+   ("divides", ("num_divides", `:num->num->bool`));
+   ("mod", ("num_mod", `:num->num->num->bool`));
+   ("coprime", ("num_coprime", `:num#num->bool`));
+   ("gcd", ("num_gcd", `:num#num->num`));
+   ("vol", ("measure", `:(real^3->bool)->real`));
+   ("NULLSET", ("negligible", `:(real^3->bool)->bool`));
+   ("+", ("vector_add", `:real^N->real^N->real^N`));
+   ("-", ("vector_sub", `:real^N->real^N->real^N`));
+   ("--", ("vector_neg", `:real^N->real^N`));
+   ("norm", ("vector_norm", `:real^N->real`));
+   ("**", ("vector_matrix_mul", `:real^M->real^N^M->real^N`));
+   ("real_interval",
+    ("closed_real_interval", `:(real#real)list->real->bool`));
+   ("real_interval", ("open_real_interval", `:real#real->real->bool`));
+   ("inv", ("complex_inv", `:real^2->real^2`));
+   ("pow", ("complex_pow", `:real^2->num->real^2`));
+   ("/", ("complex_div", `:real^2->real^2->real^2`));
+   ("*", ("complex_mul", `:real^2->real^2->real^2`));
+   ("-", ("vector_sub", `:real^2->real^2->real^2`));
+   ("+", ("vector_add", `:real^2->real^2->real^2`));
+   ("--", ("vector_neg", `:real^2->real^2`));
+   ("segment", ("closed_segment", `:(real^A#real^A)list->real^A->bool`));
+   ("segment", ("open_segment", `:real^A#real^A->real^A->bool`));
+   ("interval", ("closed_interval", `:(real^A#real^A)list->real^A->bool`));
+   ("interval", ("open_interval", `:real^A#real^A->real^A->bool`));
+   ("**", ("matrix_vector_mul", `:real^N^M->real^N->real^M`));
+   ("**", ("matrix_mul", `:real^N^M->real^P^N->real^P^M`));
+   ("-", ("matrix_sub", `:real^N^M->real^N^M->real^N^M`));
+   ("+", ("matrix_add", `:real^N^M->real^N^M->real^N^M`));
+   ("--", ("matrix_neg", `:real^N^M->real^N^M`));
+   ("dist", ("distance", `:real^N#real^N->real`));
+   ("gcd", ("int_gcd", `:int#int->int`));
+   ("coprime", ("int_coprime", `:int#int->bool`));
+   ("mod", ("int_mod", `:int->int->int->bool`));
+   ("divides", ("int_divides", `:int->int->bool`));
+   ("&", ("int_of_num", `:num->int`));
+   ("min", ("int_min", `:int->int->int`));
+   ("max", ("int_max", `:int->int->int`)); ("abs", ("int_abs", `:int->int`));
+   ("pow", ("int_pow", `:int->num->int`)); ("--", ("int_neg", `:int->int`));
+   (">=", ("int_ge", `:int->int->bool`));
+   (">", ("int_gt", `:int->int->bool`));
+   ("<=", ("int_le", `:int->int->bool`));
+   ("<", ("int_lt", `:int->int->bool`));
+   ("*", ("int_mul", `:int->int->int`));
+   ("-", ("int_sub", `:int->int->int`));
+   ("+", ("int_add", `:int->int->int`));
+   ("&", ("hreal_of_num", `:num->hreal`));
+   ("<=>", ("=", `:bool->bool->bool`))];;
+
+  let the_constants = 
+  [("SDIFF", `:(A->bool)->(A->bool)->A->bool`);
+   ("vol_ball_wedge", `:real^3->real^3->real^3->real^3->real->real`);
+   ("vol_rect", `:real^A->real^B->real`);
+   ("vol_conv", `:real^A->real^A->real^A->real^A->real`);
+   ("vol_conic_cap_wedge",
+    `:real^3->real^3->real^3->real^3->real->real->real`);
+   ("vol_frustt_wedge", `:real^3->real^3->real^3->real^3->real->real->real`);
+   ("vol_solid_triangle", `:real^A->real^A->real^A->real^A->real->real`);
+   ("primitive", `:(real^3->bool)->bool`);
+   ("circular_cone", `:(real^3->bool)->bool`);
+   ("c_cone", `:real^3#real^3#real->real^3->bool`);
+   ("sphere", `:(real^3->bool)->bool`);
+   ("rect", `:real^3->real^3->real^3->bool`);
+   ("solid_triangle", `:real^A->(real^A->bool)->real->real^A->bool`);
+   ("cone0", `:real^A->(real^A->bool)->real^A->bool`);
+   ("cone", `:real^A->(real^A->bool)->real^A->bool`);
+   ("dihV", `:real^A->real^A->real^A->real^A->real`);
+   ("opposite", `:real^N->real^N->(real^N->bool)->bool`);
+   ("arcV", `:real^A->real^A->real^A->real`);
+   ("wedge", `:real^3->real^3->real^3->real^3->real^3->bool`);
+   ("azim", `:real^3->real^3->real^3->real^3->real`);
+   ("orthonormal", `:real^3->real^3->real^3->bool`);
+   ("conic_cap", `:real^A->real^A->real->real->real^A->bool`);
+   ("ellipsoid", `:real^3->real->real^3->bool`);
+   ("normball", `:real^A->real->real^A->bool`);
+   ("scale", `:real^3->real^3->real^3`);
+   ("frustt", `:real^A->real^A->real->real->real^A->bool`);
+   ("frustum", `:real^N->real^N->real->real->real->real^N->bool`);
+   ("rcone_eq", `:real^A->real^A->real->real^A->bool`);
+   ("rcone_ge", `:real^A->real^A->real->real^A->bool`);
+   ("rcone_gt", `:real^A->real^A->real->real^A->bool`);
+   ("rconesgn", `:(real->real->bool)->real^A->real^A->real->real^A->bool`);
+   ("delta_x", `:real->real->real->real->real->real->real`);
+   ("conv0", `:(real^A->bool)->real^A->bool`);
+   ("aff_le", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_lt", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_ge", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_gt", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("sgn_le", `:real->bool`); ("sgn_lt", `:real->bool`);
+   ("sgn_ge", `:real->bool`); ("sgn_gt", `:real->bool`);
+   ("affsign", `:(real->bool)->(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("lin_combo", `:(real^N->bool)->(real^N->real)->real^N`);
+   ("pad2d3d", `:real^2->real^3`); ("plane", `:(real^A->bool)->bool`);
+   ("slice", `:num->real->(real^A->bool)->real^B->bool`);
+   ("pushin", `:num->B->B^A->B^C`); ("dropout", `:num->real^N->real^M`);
+   ("real_measure", `:(real->bool)->real`);
+   ("real_measurable", `:(real->bool)->bool`);
+   ("has_real_measure", `:(real->bool)->real->bool`);
+   ("absolutely_real_integrable_on", `:(real->real)->(real->bool)->bool`);
+   ("real_negligible", `:(real->bool)->bool`);
+   ("real_integral", `:(real->bool)->(real->real)->real`);
+   ("real_integrable_on", `:(real->real)->(real->bool)->bool`);
+   ("has_real_integral", `:(real->real)->real->(real->bool)->bool`);
+   ("closed_real_interval", `:(real#real)list->real->bool`);
+   ("open_real_interval", `:real#real->real->bool`);
+   ("is_realinterval", `:(real->bool)->bool`);
+   ("real_differentiable_on", `:(real->real)->(real->bool)->bool`);
+   ("higher_real_derivative", `:num->(real->real)->real->real`);
+   ("real_derivative", `:(real->real)->real->real`);
+   ("real_differentiable", `:(real->real)->(real)net->bool`);
+   ("has_real_derivative", `:(real->real)->real->(real)net->bool`);
+   ("real_continuous_on", `:(real->real)->(real->bool)->bool`);
+   ("real_continuous", `:(A->real)->(A)net->bool`);
+   ("at_neginfinity", `:(real)net`); ("at_posinfinity", `:(real)net`);
+   ("atreal", `:real->(real)net`);
+   ("real_summable", `:(num->bool)->(num->real)->bool`);
+   ("real_infsum", `:(num->bool)->(num->real)->real`);
+   ("real_sums", `:(num->real)->real->(num->bool)->bool`);
+   ("--->", `:(A->real)->real->(A)net->bool`);
+   ("real_compact", `:(real->bool)->bool`);
+   ("real_bounded", `:(real->bool)->bool`);
+   ("euclideanreal", `:(real)topology`);
+   ("real_closed", `:(real->bool)->bool`);
+   ("real_open", `:(real->bool)->bool`);
+   ("measure", `:(real^A->bool)->real`);
+   ("measurable", `:(real^A->bool)->bool`);
+   ("has_measure", `:(real^A->bool)->real->bool`);
+   ("*_c", `:(A->bool)->(B->bool)->A#B->bool`);
+   ("+_c", `:(A->bool)->(B->bool)->A+B->bool`);
+   ("ordinal", `:(A#A->bool)->bool`);
+   ("linseg", `:(A#A->bool)->A->A#A->bool`);
+   ("inseg", `:(A#A->bool)->(A#A->bool)->bool`);
+   ("woset", `:(A#A->bool)->bool`);
+   ("chain", `:(A#A->bool)->(A->bool)->bool`);
+   ("poset", `:(A#A->bool)->bool`); ("fl", `:(A#A->bool)->A->bool`);
+   ("less", `:(A#A->bool)->A#A->bool`);
+   ("angle", `:real^A#real^A#real^A->real`);
+   ("vector_angle", `:real^A->real^A->real`); ("acs", `:real->real`);
+   ("asn", `:real->real`); ("cacs", `:real^2->real^2`);
+   ("casn", `:real^2->real^2`); ("atn", `:real->real`);
+   ("catn", `:real^2->real^2`); ("unwinding", `:real^2->real^2`);
+   ("cpow", `:real^2->real^2->real^2`); ("clog", `:real^2->real^2`);
+   ("tan", `:real->real`); ("ctan", `:real^2->real^2`);
+   ("rotate2d", `:real->real^2->real^2`); ("Arg", `:real^2->real`);
+   ("pi", `:real`); ("log", `:real->real`); ("cos", `:real->real`);
+   ("sin", `:real->real`); ("exp", `:real->real`);
+   ("csin", `:real^2->real^2`); ("ccos", `:real^2->real^2`);
+   ("cexp", `:real^2->real^2`);
+   ("analytic_on", `:(real^2->real^2)->(real^2->bool)->bool`);
+   ("holomorphic_on", `:(real^2->real^2)->(real^2->bool)->bool`);
+   ("higher_complex_derivative", `:num->(real^2->real^2)->real^2->real^2`);
+   ("complex_derivative", `:(real^2->real^2)->real^2->real^2`);
+   ("complex_differentiable", `:(real^2->real^2)->(real^2)net->bool`);
+   ("has_complex_derivative", `:(real^2->real^2)->real^2->(real^2)net->bool`);
+   ("cproduct", `:(A->bool)->(A->real^2)->real^2`);
+   ("real", `:real^2->bool`); ("csqrt", `:real^2->real^2`);
+   ("cnj", `:real^2->real^2`); ("complex_pow", `:real^2->num->real^2`);
+   ("complex_div", `:real^2->real^2->real^2`);
+   ("complex_inv", `:real^2->real^2`);
+   ("complex_mul", `:real^2->real^2->real^2`); ("ii", `:real^2`);
+   ("Cx", `:real->real^2`); ("complex", `:real#real->real^2`);
+   ("Im", `:real^2->real`); ("Re", `:real^2->real`);
+   ("absolutely_integrable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("negligible", `:(real^A->bool)->bool`);
+   ("indicator", `:(real^M->bool)->real^M->real^1`);
+   ("division_points",
+    `:(real^N->bool)->((real^N->bool)->bool)->num#real->bool`);
+   ("lifted", `:(A->A->B)->(A)option->(A)option->(B)option`);
+   ("operative", `:(A->A->A)->((real^N->bool)->A)->bool`);
+   ("integral", `:(real^A->bool)->(real^A->real^B)->real^B`);
+   ("integrable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("has_integral", `:(real^B->real^A)->real^A->(real^B->bool)->bool`);
+   ("has_integral_compact_interval",
+    `:(real^B->real^A)->real^A->(real^B->bool)->bool`);
+   ("fine", `:(A->B->bool)->(A#(B->bool)->bool)->bool`);
+   ("tagged_division_of",
+    `:(real^A#(real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("tagged_partial_division_of",
+    `:(real^A#(real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("division_of", `:((real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("gauge", `:(real^A->real^A->bool)->bool`);
+   ("content", `:(real^M->bool)->real`);
+   ("interval_lowerbound", `:(real^M->bool)->real^M`);
+   ("interval_upperbound", `:(real^M->bool)->real^M`);
+   ("vector_derivative", `:(real^1->real^N)->(real^1)net->real^N`);
+   ("has_vector_derivative", `:(real^1->real^A)->real^A->(real^1)net->bool`);
+   ("jacobian", `:(real^A->real^B)->(real^A)net->real^A^B`);
+   ("frechet_derivative", `:(real^A->real^B)->(real^A)net->real^A->real^B`);
+   ("differentiable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("differentiable", `:(real^B->real^A)->(real^B)net->bool`);
+   ("has_derivative",
+    `:(real^B->real^A)->(real^B->real^A)->(real^B)net->bool`);
+   ("interval_bij", `:real^N#real^N->real^N#real^N->real^N->real^N`);
+   ("retract_of", `:(real^A->bool)->(real^A->bool)->bool`);
+   ("retraction", `:(real^N->bool)#(real^N->bool)->(real^N->real^N)->bool`);
+   ("reduced", `:((num->num)->num->num)->num->(num->num)->num`);
+   ("ksimplex", `:num->num->((num->num)->bool)->bool`);
+   ("kle", `:num->(num->num)->(num->num)->bool`);
+   ("path_connected", `:(real^A->bool)->bool`);
+   ("path_component", `:(real^A->bool)->real^A->real^A->bool`);
+   ("linepath", `:real^A#real^A->real^1->real^A`);
+   ("shiftpath", `:real^1->(real^1->real^N)->real^1->real^N`);
+   ("arc", `:(real^1->real^N)->bool`);
+   ("simple_path", `:(real^1->real^N)->bool`);
+   ("++", `:(real^1->A)->(real^1->A)->real^1->A`);
+   ("reversepath", `:(real^1->real^N)->real^1->real^N`);
+   ("path_image", `:(real^1->real^N)->real^N->bool`);
+   ("pathfinish", `:(real^1->real^N)->real^N`);
+   ("pathstart", `:(real^1->real^N)->real^N`);
+   ("path", `:(real^1->real^N)->bool`);
+   ("extreme_point_of", `:real^A->(real^A->bool)->bool`);
+   ("face_of", `:(real^A->bool)->(real^A->bool)->bool`);
+   ("relative_interior", `:(real^A->bool)->real^A->bool`);
+   ("starlike", `:(real^A->bool)->bool`);
+   ("epigraph",
+    `:(real^N->bool)->(real^N->real)->real^(N,1)finite_sum->bool`);
+   ("convex_on", `:(real^A->real)->(real^A->bool)->bool`);
+   ("coplanar", `:(real^A->bool)->bool`);
+   ("affine_dependent", `:(real^N->bool)->bool`);
+   ("conic", `:(real^A->bool)->bool`); ("convex", `:(real^A->bool)->bool`);
+   ("affine", `:(real^A->bool)->bool`);
+   ("closest_point", `:(real^A->bool)->real^A->real^A`);
+   ("from", `:num->num->bool`);
+   ("summable", `:(num->bool)->(num->real^A)->bool`);
+   ("infsum", `:(num->bool)->(num->real^A)->real^A`);
+   ("sums", `:(num->real^A)->real^A->(num->bool)->bool`);
+   ("homeomorphic", `:(real^A->bool)->(real^B->bool)->bool`);
+   ("homeomorphism",
+    `:(real^B->bool)#(real^A->bool)->(real^B->real^A)#(real^A->real^B)->bool`);
+   ("open_segment", `:real^A#real^A->real^A->bool`);
+   ("closed_segment", `:(real^A#real^A)list->real^A->bool`);
+   ("is_interval", `:(real^N->bool)->bool`);
+   ("closed_interval", `:(real^N#real^N)list->real^N->bool`);
+   ("open_interval", `:real^N#real^N->real^N->bool`);
+   ("diameter", `:(real^A->bool)->real`);
+   ("connected_component", `:(real^A->bool)->real^A->real^A->bool`);
+   ("uniformly_continuous_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("continuous_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("continuous", `:(B->real^A)->(B)net->bool`);
+   ("complete", `:(real^N->bool)->bool`); ("cauchy", `:(num->real^N)->bool`);
+   ("compact", `:(real^N->bool)->bool`);
+   ("bounded", `:(real^N->bool)->bool`); ("netlimit", `:(A)net->A`);
+   ("lim", `:(A)net->(A->real^B)->real^B`);
+   ("-->", `:(B->real^A)->real^A->(B)net->bool`);
+   ("eventually", `:(A->bool)->(A)net->bool`);
+   ("trivial_limit", `:(A)net->bool`);
+   ("in_direction", `:real^A->real^A->(real^A)net`);
+   ("within", `:(A)net->(A->bool)->(A)net`); ("sequentially", `:(num)net`);
+   ("at_infinity", `:(real^A)net`); ("at", `:real^A->(real^A)net`);
+   ("netord", `:(A)net->A->A->bool`); ("mk_net", `:(A->A->bool)->(A)net`);
+   ("frontier", `:(real^A->bool)->real^A->bool`);
+   ("closure", `:(real^A->bool)->real^A->bool`);
+   ("interior", `:(real^A->bool)->real^A->bool`);
+   ("limit_point_of", `:real^A->(real^A->bool)->bool`);
+   ("connected", `:(real^A->bool)->bool`);
+   ("cball", `:real^A#real->real^A->bool`);
+   ("ball", `:real^A#real->real^A->bool`);
+   ("euclidean", `:(real^A)topology`); ("closed", `:(real^N->bool)->bool`);
+   ("open", `:(real^A->bool)->bool`);
+   ("subtopology", `:(A)topology->(A->bool)->(A)topology`);
+   ("closed_in", `:(A)topology->(A->bool)->bool`);
+   ("topspace", `:(A)topology->A->bool`);
+   ("open_in", `:(A)topology->(A->bool)->bool`);
+   ("topology", `:((A->bool)->bool)->(A)topology`);
+   ("istopology", `:((A->bool)->bool)->bool`);
+   ("ITER", `:num->(A->A)->A->A`); ("frac", `:real->real`);
+   ("floor", `:real->real`); ("integer", `:real->bool`);
+   ("cross", `:real^3->real^3->real^3`);
+   ("rotoinversion_matrix", `:real^A^A->bool`);
+   ("rotation_matrix", `:real^A^A->bool`);
+   ("orthogonal_matrix", `:real^N^N->bool`);
+   ("orthogonal_transformation", `:(real^N->real^N)->bool`);
+   ("det", `:real^N^N->real`); ("trace", `:real^N^N->real`);
+   ("product", `:(A->bool)->(A->real)->real`); ("sign", `:(A->A)->real`);
+   ("evenperm", `:(A->A)->bool`); ("permutation", `:(A->A)->bool`);
+   ("swapseq", `:num->(A->A)->bool`); ("swap", `:A#A->A->A`);
+   ("inverse", `:(B->A)->A->B`); ("permutes", `:(A->A)->(A->bool)->bool`);
+   ("midpoint", `:real^A#real^A->real^A`);
+   ("between", `:real^A->real^A#real^A->bool`);
+   ("collinear", `:(real^A->bool)->bool`); ("infnorm", `:real^N->real`);
+   ("rank", `:real^M^N->num`); ("columnvector", `:real^N->real^1^N`);
+   ("rowvector", `:real^N->real^N^1`); ("dim", `:(real^A->bool)->num`);
+   ("independent", `:(real^A->bool)->bool`);
+   ("dependent", `:(real^A->bool)->bool`);
+   ("span", `:(real^A->bool)->real^A->bool`);
+   ("subspace", `:(real^A->bool)->bool`); ("drop", `:real^1->real`);
+   ("lift", `:real->real^1`); ("onorm", `:(real^M->real^N)->real`);
+   ("matrix", `:(real^M->real^N)->real^M^N`);
+   ("matrix_inv", `:real^N^M->real^M^N`); ("invertible", `:real^N^M->bool`);
+   ("columns", `:real^N^M->real^M->bool`);
+   ("rows", `:real^N^M->real^N->bool`); ("column", `:num->real^N^M->real^M`);
+   ("row", `:num->real^N^M->real^N`); ("transp", `:real^N^M->real^M^N`);
+   ("mat", `:num->real^N^M`);
+   ("vector_matrix_mul", `:real^M->real^N^M->real^N`);
+   ("matrix_vector_mul", `:real^N^M->real^N->real^M`);
+   ("matrix_mul", `:real^N^M->real^P^N->real^P^M`);
+   ("matrix_sub", `:real^N^M->real^N^M->real^N^M`);
+   ("matrix_add", `:real^N^M->real^N^M->real^N^M`);
+   ("matrix_neg", `:real^N^M->real^N^M`);
+   ("adjoint", `:(real^M->real^N)->real^N->real^M`);
+   ("bilinear", `:(real^A->real^B->real^C)->bool`);
+   ("linear", `:(real^M->real^N)->bool`);
+   ("orthogonal", `:real^A->real^A->bool`); ("basis", `:num->real^A`);
+   ("vsum", `:(A->bool)->(A->real^N)->real^N`);
+   ("distance", `:real^A#real^A->real`); ("vector_norm", `:real^A->real`);
+   ("dot", `:real^N->real^N->real`); ("vec", `:num->real^N`);
+   ("%", `:real->real^N->real^N`); ("vector_neg", `:real^N->real^N`);
+   ("vector_sub", `:real^N->real^N->real^N`);
+   ("vector_add", `:real^N->real^N->real^N`); ("sqrt", `:real->real`);
+   ("hull", `:((A->bool)->bool)->(A->bool)->A->bool`);
+   ("inf", `:(real->bool)->real`); ("sup", `:(real->bool)->real`);
+   ("superadmissible",
+    `:(A->A->bool)->((A->C)->B->bool)->(B->A)->((A->C)->B->C)->bool`);
+   ("tailadmissible",
+    `:(A->A->bool)->((A->B)->P->bool)->(P->A)->((A->B)->P->B)->bool`);
+   ("admissible",
+    `:(B->A->bool)->((B->C)->D->bool)->(D->A)->((B->C)->D->E)->bool`);
+   ("CASEWISE", `:((A->C)#(B->A->D))list->B->C->D`);
+   ("vector", `:(A)list->A^N`);
+   ("dest_auto_define_finite_type_3", `:3->num`);
+   ("mk_auto_define_finite_type_3", `:num->3`);
+   ("dest_auto_define_finite_type_2", `:2->num`);
+   ("mk_auto_define_finite_type_2", `:num->2`);
+   ("sndcart", `:A^(M,N)finite_sum->A^N`);
+   ("fstcart", `:A^(M,N)finite_sum->A^M`);
+   ("pastecart", `:A^M->A^N->A^(M,N)finite_sum`);
+   ("dest_finite_sum", `:(A,B)finite_sum->num`);
+   ("mk_finite_sum", `:num->(A,B)finite_sum`); ("lambda", `:(num->A)->A^B`);
+   ("$", `:B^A->num->B`); ("dest_cart", `:A^B->(B)finite_image->A`);
+   ("mk_cart", `:((B)finite_image->A)->A^B`);
+   ("dest_finite_image", `:(A)finite_image->num`);
+   ("finite_index", `:num->(A)finite_image`);
+   ("dimindex", `:(A->bool)->num`); ("sum", `:(A->bool)->(A->real)->real`);
+   ("nsum", `:(A->bool)->(A->num)->num`);
+   ("iterate", `:(B->B->B)->(A->bool)->(A->B)->B`);
+   ("support", `:(B->B->B)->(A->B)->(A->bool)->A->bool`);
+   ("monoidal", `:(A->A->A)->bool`); ("neutral", `:(A->A->A)->A`);
+   ("..", `:num->num->num->bool`); ("COUNTABLE", `:(A->bool)->bool`);
+   (">_c", `:(A->bool)->(B->bool)->bool`);
+   (">=_c", `:(A->bool)->(B->bool)->bool`);
+   ("=_c", `:(A->bool)->(B->bool)->bool`);
+   ("<_c", `:(A->bool)->(B->bool)->bool`);
+   ("<=_c", `:(A->bool)->(B->bool)->bool`);
+   ("PAIRWISE", `:(A->A->bool)->(A)list->bool`);
+   ("pairwise", `:(A->A->bool)->(A->bool)->bool`);
+   ("list_of_set", `:(A->bool)->(A)list`);
+   ("set_of_list", `:(A)list->A->bool`);
+   ("CROSS", `:(A->bool)->(B->bool)->A#B->bool`);
+   ("HAS_SIZE", `:(A->bool)->num->bool`); ("CARD", `:(A->bool)->num`);
+   ("ITSET", `:(A->B->B)->(A->bool)->B->B`);
+   ("FINREC", `:(A->B->B)->B->(A->bool)->B->num->bool`);
+   ("REST", `:(A->bool)->A->bool`); ("CHOICE", `:(A->bool)->A`);
+   ("BIJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("SURJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("INJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("IMAGE", `:(A->B)->(A->bool)->B->bool`);
+   ("INFINITE", `:(A->bool)->bool`); ("FINITE", `:(A->bool)->bool`);
+   ("SING", `:(A->bool)->bool`); ("DISJOINT", `:(A->bool)->(A->bool)->bool`);
+   ("PSUBSET", `:(A->bool)->(A->bool)->bool`);
+   ("SUBSET", `:(A->bool)->(A->bool)->bool`);
+   ("DELETE", `:(A->bool)->A->A->bool`);
+   ("DIFF", `:(A->bool)->(A->bool)->A->bool`);
+   ("INTERS", `:((A->bool)->bool)->A->bool`);
+   ("INTER", `:(A->bool)->(A->bool)->A->bool`);
+   ("UNIONS", `:((A->bool)->bool)->A->bool`);
+   ("UNION", `:(A->bool)->(A->bool)->A->bool`); ("UNIV", `:A->bool`);
+   ("INSERT", `:A->(A->bool)->A->bool`); ("EMPTY", `:A->bool`);
+   ("SETSPEC", `:A->bool->A->bool`); ("GSPEC", `:(A->bool)->A->bool`);
+   ("IN", `:A->(A->bool)->bool`); ("num_gcd", `:num#num->num`);
+   ("num_coprime", `:num#num->bool`); ("num_mod", `:num->num->num->bool`);
+   ("num_divides", `:num->num->bool`); ("num_of_int", `:int->num`);
+   ("int_gcd", `:int#int->int`); ("int_coprime", `:int#int->bool`);
+   ("int_mod", `:int->int->int->bool`); ("int_divides", `:int->int->bool`);
+   ("real_mod", `:real->real->real->bool`);
+   ("==", `:A->A->(A->A->bool)->bool`); ("rem", `:int->int->int`);
+   ("div", `:int->int->int`); ("int_pow", `:int->num->int`);
+   ("int_min", `:int->int->int`); ("int_max", `:int->int->int`);
+   ("int_abs", `:int->int`); ("int_mul", `:int->int->int`);
+   ("int_sub", `:int->int->int`); ("int_add", `:int->int->int`);
+   ("int_neg", `:int->int`); ("int_of_num", `:num->int`);
+   ("int_gt", `:int->int->bool`); ("int_ge", `:int->int->bool`);
+   ("int_lt", `:int->int->bool`); ("int_le", `:int->int->bool`);
+   ("real_of_int", `:int->real`); ("int_of_real", `:real->int`);
+   ("is_int", `:real->bool`); ("DECIMAL", `:num->num->real`);
+   ("real_min", `:real->real->real`); ("real_max", `:real->real->real`);
+   ("real_div", `:real->real->real`); ("real_pow", `:real->num->real`);
+   ("real_abs", `:real->real`); ("real_gt", `:real->real->bool`);
+   ("real_ge", `:real->real->bool`); ("real_lt", `:real->real->bool`);
+   ("real_sub", `:real->real->real`); ("real_inv", `:real->real`);
+   ("real_le", `:real->real->bool`); ("real_mul", `:real->real->real`);
+   ("real_add", `:real->real->real`); ("real_neg", `:real->real`);
+   ("real_of_num", `:num->real`); ("dest_real", `:real->hreal#hreal->bool`);
+   ("mk_real", `:(hreal#hreal->bool)->real`);
+   ("treal_eq", `:hreal#hreal->hreal#hreal->bool`);
+   ("treal_inv", `:hreal#hreal->hreal#hreal`);
+   ("treal_le", `:hreal#hreal->hreal#hreal->bool`);
+   ("treal_mul", `:hreal#hreal->hreal#hreal->hreal#hreal`);
+   ("treal_add", `:hreal#hreal->hreal#hreal->hreal#hreal`);
+   ("treal_neg", `:hreal#hreal->hreal#hreal`);
+   ("treal_of_num", `:num->hreal#hreal`); ("hreal_inv", `:hreal->hreal`);
+   ("hreal_le", `:hreal->hreal->bool`);
+   ("hreal_mul", `:hreal->hreal->hreal`);
+   ("hreal_add", `:hreal->hreal->hreal`); ("hreal_of_num", `:num->hreal`);
+   ("dest_hreal", `:hreal->nadd->bool`);
+   ("mk_hreal", `:(nadd->bool)->hreal`); ("nadd_inv", `:nadd->nadd`);
+   ("nadd_rinv", `:nadd->num->num`); ("nadd_mul", `:nadd->nadd->nadd`);
+   ("nadd_add", `:nadd->nadd->nadd`); ("nadd_le", `:nadd->nadd->bool`);
+   ("nadd_of_num", `:num->nadd`); ("nadd_eq", `:nadd->nadd->bool`);
+   ("dest_nadd", `:nadd->num->num`); ("mk_nadd", `:(num->num)->nadd`);
+   ("is_nadd", `:(num->num)->bool`); ("dist", `:num#num->num`);
+   ("ASCII", `:bool->bool->bool->bool->bool->bool->bool->bool->char`);
+   ("_16756", `:bool->bool->bool->bool->bool->bool->bool->bool->char`);
+   ("_dest_char", `:char->(bool#bool#bool#bool#bool#bool#bool#bool)recspace`);
+   ("_mk_char", `:(bool#bool#bool#bool#bool#bool#bool#bool)recspace->char`);
+   ("ZIP", `:(A)list->(B)list->(A#B)list`);
+   ("ITLIST2", `:(A->B->C->C)->(A)list->(B)list->C->C`);
+   ("ASSOC", `:A->(A#B)list->B`); ("FILTER", `:(A->bool)->(A)list->(A)list`);
+   ("EL", `:num->(A)list->A`);
+   ("MAP2", `:(A->B->C)->(A)list->(B)list->(C)list`);
+   ("ALL2", `:(A->B->bool)->(A)list->(B)list->bool`);
+   ("MEM", `:A->(A)list->bool`); ("ITLIST", `:(A->B->B)->(A)list->B->B`);
+   ("EX", `:(A->bool)->(A)list->bool`); ("ALL", `:(A->bool)->(A)list->bool`);
+   ("NULL", `:(A)list->bool`); ("REPLICATE", `:num->A->(A)list`);
+   ("LAST", `:(A)list->A`); ("MAP", `:(A->B)->(A)list->(B)list`);
+   ("LENGTH", `:(A)list->num`); ("REVERSE", `:(A)list->(A)list`);
+   ("APPEND", `:(A)list->(A)list->(A)list`); ("TL", `:(A)list->(A)list`);
+   ("HD", `:(A)list->A`); ("ISO", `:(A->B)->(B->A)->bool`);
+   ("CONS", `:A->(A)list->(A)list`); ("NIL", `:(A)list`);
+   ("_dest_list", `:(A)list->(A)recspace`);
+   ("_mk_list", `:(A)recspace->(A)list`); ("SOME", `:A->(A)option`);
+   ("NONE", `:(A)option`); ("_dest_option", `:(A)option->(A)recspace`);
+   ("_mk_option", `:(A)recspace->(A)option`); ("OUTR", `:A+B->B`);
+   ("OUTL", `:A+B->A`); ("INR", `:B->A+B`); ("INL", `:A->A+B`);
+   ("_dest_sum", `:A+B->(A#B)recspace`); ("_mk_sum", `:(A#B)recspace->A+B`);
+   ("FNIL", `:num->A`); ("FCONS", `:A->(num->A)->num->A`);
+   ("CONSTR", `:num->A->(num->(A)recspace)->(A)recspace`);
+   ("BOTTOM", `:(A)recspace`); ("_dest_rec", `:(A)recspace->num->A->bool`);
+   ("_mk_rec", `:(num->A->bool)->(A)recspace`);
+   ("ZRECSPACE", `:(num->A->bool)->bool`); ("ZBOT", `:num->A->bool`);
+   ("ZCONSTR", `:num->A->(num->num->A->bool)->num->A->bool`);
+   ("INJP", `:(num->A->bool)->(num->A->bool)->num->A->bool`);
+   ("INJF", `:(num->num->A->bool)->num->A->bool`);
+   ("INJA", `:A->num->A->bool`); ("INJN", `:num->num->A->bool`);
+   ("NUMRIGHT", `:num->num`); ("NUMLEFT", `:num->bool`);
+   ("NUMSUM", `:bool->num->num`); ("NUMSND", `:num->num`);
+   ("NUMFST", `:num->num`); ("NUMPAIR", `:num->num->num`);
+   ("MEASURE", `:(A->num)->A->A->bool`); ("WF", `:(A->A->bool)->bool`);
+   ("minimal", `:(num->bool)->num`); ("MIN", `:num->num->num`);
+   ("MAX", `:num->num->num`); ("MOD", `:num->num->num`);
+   ("DIV", `:num->num->num`); ("FACT", `:num->num`); ("-", `:num->num->num`);
+   ("ODD", `:num->bool`); ("EVEN", `:num->bool`); (">", `:num->num->bool`);
+   (">=", `:num->num->bool`); ("<", `:num->num->bool`);
+   ("<=", `:num->num->bool`); ("EXP", `:num->num->num`);
+   ("*", `:num->num->num`); ("BIT1", `:num->num`); ("BIT0", `:num->num`);
+   ("+", `:num->num->num`); ("PRE", `:num->num`); ("NUMERAL", `:num->num`);
+   ("SUC", `:num->num`); ("_0", `:num`); ("dest_num", `:num->ind`);
+   ("mk_num", `:ind->num`); ("NUM_REP", `:ind->bool`); ("IND_0", `:ind`);
+   ("IND_SUC", `:ind->ind`); ("ONTO", `:(A->B)->bool`);
+   ("ONE_ONE", `:(A->B)->bool`); ("PASSOC", `:((A#B)#C->D)->A#B#C->D`);
+   ("UNCURRY", `:(A->B->C)->A#B->C`); ("CURRY", `:(A#B->C)->A->B->C`);
+   ("SND", `:A#B->B`); ("FST", `:A#B->A`); (",", `:A->B->A#B`);
+   ("REP_prod", `:A#B->A->B->bool`); ("ABS_prod", `:(A->B->bool)->A#B`);
+   ("mk_pair", `:A->B->A->B->bool`); ("_FUNCTION", `:(A->B->bool)->A->B`);
+   ("_MATCH", `:A->(A->B->bool)->B`);
+   ("_GUARDED_PATTERN", `:bool->bool->bool->bool`);
+   ("_UNGUARDED_PATTERN", `:bool->bool->bool`);
+   ("_SEQPATTERN", `:(A->B->bool)->(A->B->bool)->A->B->bool`);
+   ("GEQ", `:A->A->bool`); ("GABS", `:(A->bool)->A`); ("LET_END", `:A->A`);
+   ("LET", `:(A->B)->A->B`); ("one", `:1`); ("one_REP", `:1->bool`);
+   ("one_ABS", `:bool->1`); ("I", `:A->A`); ("o", `:(B->C)->(A->B)->A->C`);
+   ("COND", `:bool->A->A->A`); ("@", `:(A->bool)->A`);
+   ("_FALSITY_", `:bool`); ("?!", `:(A->bool)->bool`); ("~", `:bool->bool`);
+   ("F", `:bool`); ("\\/", `:bool->bool->bool`); ("?", `:(A->bool)->bool`);
+   ("!", `:(A->bool)->bool`); ("==>", `:bool->bool->bool`);
+   ("/\\", `:bool->bool->bool`); ("T", `:bool`); ("=", `:A->A->bool`)];;  
+
+end;;
+
+
+module Snapshot_v220_7_31_2009 : Snapshot_type = struct
+
+  let the_constants =
+  [("SDIFF", `:(A->bool)->(A->bool)->A->bool`);
+   ("vol_ball_wedge", `:real^3->real^3->real^3->real^3->real->real`);
+   ("vol_rect", `:real^A->real^B->real`);
+   ("vol_conv", `:real^A->real^A->real^A->real^A->real`);
+   ("vol_conic_cap_wedge",
+    `:real^3->real^3->real^3->real^3->real->real->real`);
+   ("vol_frustt_wedge", `:real^3->real^3->real^3->real^3->real->real->real`);
+   ("vol_solid_triangle", `:real^A->real^A->real^A->real^A->real->real`);
+   ("primitive", `:(real^3->bool)->bool`);
+   ("circular_cone", `:(real^3->bool)->bool`);
+   ("c_cone", `:real^3#real^3#real->real^3->bool`);
+   ("sphere", `:(real^3->bool)->bool`);
+   ("rect", `:real^3->real^3->real^3->bool`);
+   ("solid_triangle", `:real^A->(real^A->bool)->real->real^A->bool`);
+   ("cone0", `:real^A->(real^A->bool)->real^A->bool`);
+   ("cone", `:real^A->(real^A->bool)->real^A->bool`);
+   ("dihV", `:real^A->real^A->real^A->real^A->real`);
+   ("opposite", `:real^N->real^N->(real^N->bool)->bool`);
+   ("wedge", `:real^3->real^3->real^3->real^3->real^3->bool`);
+   ("azim", `:real^3->real^3->real^3->real^3->real`);
+   ("arcV", `:real^A->real^A->real^A->real`);
+   ("orthonormal", `:real^3->real^3->real^3->bool`);
+   ("conic_cap", `:real^A->real^A->real->real->real^A->bool`);
+   ("ellipsoid", `:real^3->real->real^3->bool`);
+   ("normball", `:real^A->real->real^A->bool`);
+   ("scale", `:real^3->real^3->real^3`);
+   ("frustt", `:real^A->real^A->real->real->real^A->bool`);
+   ("frustum", `:real^N->real^N->real->real->real->real^N->bool`);
+   ("rcone_eq", `:real^A->real^A->real->real^A->bool`);
+   ("rcone_ge", `:real^A->real^A->real->real^A->bool`);
+   ("rcone_gt", `:real^A->real^A->real->real^A->bool`);
+   ("rconesgn", `:(real->real->bool)->real^A->real^A->real->real^A->bool`);
+   ("delta_x", `:real->real->real->real->real->real->real`);
+   ("conv0", `:(real^A->bool)->real^A->bool`);
+   ("aff_le", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_lt", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_ge", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("aff_gt", `:(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("sgn_le", `:real->bool`); ("sgn_lt", `:real->bool`);
+   ("sgn_ge", `:real->bool`); ("sgn_gt", `:real->bool`);
+   ("affsign", `:(real->bool)->(real^A->bool)->(real^A->bool)->real^A->bool`);
+   ("lin_combo", `:(real^N->bool)->(real^N->real)->real^N`);
+   ("pad2d3d", `:real^2->real^3`); ("plane", `:(real^A->bool)->bool`);
+   ("slice", `:num->real->(real^A->bool)->real^B->bool`);
+   ("pushin", `:num->B->B^A->B^C`); ("dropout", `:num->real^N->real^M`);
+   ("real_measure", `:(real->bool)->real`);
+   ("real_measurable", `:(real->bool)->bool`);
+   ("has_real_measure", `:(real->bool)->real->bool`);
+   ("absolutely_real_integrable_on", `:(real->real)->(real->bool)->bool`);
+   ("real_negligible", `:(real->bool)->bool`);
+   ("real_integral", `:(real->bool)->(real->real)->real`);
+   ("real_integrable_on", `:(real->real)->(real->bool)->bool`);
+   ("has_real_integral", `:(real->real)->real->(real->bool)->bool`);
+   ("closed_real_interval", `:(real#real)list->real->bool`);
+   ("open_real_interval", `:real#real->real->bool`);
+   ("is_realinterval", `:(real->bool)->bool`);
+   ("real_differentiable_on", `:(real->real)->(real->bool)->bool`);
+   ("higher_real_derivative", `:num->(real->real)->real->real`);
+   ("real_derivative", `:(real->real)->real->real`);
+   ("real_differentiable", `:(real->real)->(real)net->bool`);
+   ("has_real_derivative", `:(real->real)->real->(real)net->bool`);
+   ("real_continuous_on", `:(real->real)->(real->bool)->bool`);
+   ("real_continuous", `:(A->real)->(A)net->bool`);
+   ("at_neginfinity", `:(real)net`); ("at_posinfinity", `:(real)net`);
+   ("atreal", `:real->(real)net`);
+   ("real_summable", `:(num->bool)->(num->real)->bool`);
+   ("real_infsum", `:(num->bool)->(num->real)->real`);
+   ("real_sums", `:(num->real)->real->(num->bool)->bool`);
+   ("--->", `:(A->real)->real->(A)net->bool`);
+   ("real_compact", `:(real->bool)->bool`);
+   ("real_bounded", `:(real->bool)->bool`);
+   ("euclideanreal", `:(real)topology`);
+   ("real_closed", `:(real->bool)->bool`);
+   ("real_open", `:(real->bool)->bool`);
+   ("measure", `:(real^A->bool)->real`);
+   ("measurable", `:(real^A->bool)->bool`);
+   ("has_measure", `:(real^A->bool)->real->bool`);
+   ("*_c", `:(A->bool)->(B->bool)->A#B->bool`);
+   ("+_c", `:(A->bool)->(B->bool)->A+B->bool`);
+   ("ordinal", `:(A#A->bool)->bool`);
+   ("linseg", `:(A#A->bool)->A->A#A->bool`);
+   ("inseg", `:(A#A->bool)->(A#A->bool)->bool`);
+   ("woset", `:(A#A->bool)->bool`);
+   ("chain", `:(A#A->bool)->(A->bool)->bool`);
+   ("poset", `:(A#A->bool)->bool`); ("fl", `:(A#A->bool)->A->bool`);
+   ("less", `:(A#A->bool)->A#A->bool`);
+   ("angle", `:real^A#real^A#real^A->real`);
+   ("vector_angle", `:real^A->real^A->real`); ("acs", `:real->real`);
+   ("asn", `:real->real`); ("cacs", `:real^2->real^2`);
+   ("casn", `:real^2->real^2`); ("atn", `:real->real`);
+   ("catn", `:real^2->real^2`); ("unwinding", `:real^2->real^2`);
+   ("cpow", `:real^2->real^2->real^2`); ("clog", `:real^2->real^2`);
+   ("tan", `:real->real`); ("ctan", `:real^2->real^2`);
+   ("rotate2d", `:real->real^2->real^2`); ("Arg", `:real^2->real`);
+   ("pi", `:real`); ("log", `:real->real`); ("cos", `:real->real`);
+   ("sin", `:real->real`); ("exp", `:real->real`);
+   ("csin", `:real^2->real^2`); ("ccos", `:real^2->real^2`);
+   ("cexp", `:real^2->real^2`);
+   ("analytic_on", `:(real^2->real^2)->(real^2->bool)->bool`);
+   ("holomorphic_on", `:(real^2->real^2)->(real^2->bool)->bool`);
+   ("higher_complex_derivative", `:num->(real^2->real^2)->real^2->real^2`);
+   ("complex_derivative", `:(real^2->real^2)->real^2->real^2`);
+   ("complex_differentiable", `:(real^2->real^2)->(real^2)net->bool`);
+   ("has_complex_derivative", `:(real^2->real^2)->real^2->(real^2)net->bool`);
+   ("cproduct", `:(A->bool)->(A->real^2)->real^2`);
+   ("real", `:real^2->bool`); ("csqrt", `:real^2->real^2`);
+   ("cnj", `:real^2->real^2`); ("complex_pow", `:real^2->num->real^2`);
+   ("complex_div", `:real^2->real^2->real^2`);
+   ("complex_inv", `:real^2->real^2`);
+   ("complex_mul", `:real^2->real^2->real^2`); ("ii", `:real^2`);
+   ("Cx", `:real->real^2`); ("complex", `:real#real->real^2`);
+   ("Im", `:real^2->real`); ("Re", `:real^2->real`);
+   ("absolutely_integrable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("negligible", `:(real^A->bool)->bool`);
+   ("indicator", `:(real^M->bool)->real^M->real^1`);
+   ("division_points",
+    `:(real^N->bool)->((real^N->bool)->bool)->num#real->bool`);
+   ("lifted", `:(A->A->B)->(A)option->(A)option->(B)option`);
+   ("operative", `:(A->A->A)->((real^N->bool)->A)->bool`);
+   ("integral", `:(real^A->bool)->(real^A->real^B)->real^B`);
+   ("integrable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("has_integral", `:(real^B->real^A)->real^A->(real^B->bool)->bool`);
+   ("has_integral_compact_interval",
+    `:(real^B->real^A)->real^A->(real^B->bool)->bool`);
+   ("fine", `:(A->B->bool)->(A#(B->bool)->bool)->bool`);
+   ("tagged_division_of",
+    `:(real^A#(real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("tagged_partial_division_of",
+    `:(real^A#(real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("division_of", `:((real^A->bool)->bool)->(real^A->bool)->bool`);
+   ("gauge", `:(real^A->real^A->bool)->bool`);
+   ("content", `:(real^M->bool)->real`);
+   ("interval_lowerbound", `:(real^M->bool)->real^M`);
+   ("interval_upperbound", `:(real^M->bool)->real^M`);
+   ("vector_derivative", `:(real^1->real^N)->(real^1)net->real^N`);
+   ("has_vector_derivative", `:(real^1->real^A)->real^A->(real^1)net->bool`);
+   ("jacobian", `:(real^A->real^B)->(real^A)net->real^A^B`);
+   ("frechet_derivative", `:(real^A->real^B)->(real^A)net->real^A->real^B`);
+   ("differentiable_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("differentiable", `:(real^B->real^A)->(real^B)net->bool`);
+   ("has_derivative",
+    `:(real^B->real^A)->(real^B->real^A)->(real^B)net->bool`);
+   ("interval_bij", `:real^N#real^N->real^N#real^N->real^N->real^N`);
+   ("retract_of", `:(real^A->bool)->(real^A->bool)->bool`);
+   ("retraction", `:(real^N->bool)#(real^N->bool)->(real^N->real^N)->bool`);
+   ("reduced", `:((num->num)->num->num)->num->(num->num)->num`);
+   ("ksimplex", `:num->num->((num->num)->bool)->bool`);
+   ("kle", `:num->(num->num)->(num->num)->bool`);
+   ("path_connected", `:(real^A->bool)->bool`);
+   ("path_component", `:(real^A->bool)->real^A->real^A->bool`);
+   ("linepath", `:real^A#real^A->real^1->real^A`);
+   ("shiftpath", `:real^1->(real^1->real^N)->real^1->real^N`);
+   ("arc", `:(real^1->real^N)->bool`);
+   ("simple_path", `:(real^1->real^N)->bool`);
+   ("++", `:(real^1->A)->(real^1->A)->real^1->A`);
+   ("reversepath", `:(real^1->real^N)->real^1->real^N`);
+   ("path_image", `:(real^1->real^N)->real^N->bool`);
+   ("pathfinish", `:(real^1->real^N)->real^N`);
+   ("pathstart", `:(real^1->real^N)->real^N`);
+   ("path", `:(real^1->real^N)->bool`);
+   ("extreme_point_of", `:real^A->(real^A->bool)->bool`);
+   ("face_of", `:(real^A->bool)->(real^A->bool)->bool`);
+   ("relative_interior", `:(real^A->bool)->real^A->bool`);
+   ("starlike", `:(real^A->bool)->bool`);
+   ("epigraph",
+    `:(real^N->bool)->(real^N->real)->real^(N,1)finite_sum->bool`);
+   ("convex_on", `:(real^A->real)->(real^A->bool)->bool`);
+   ("coplanar", `:(real^A->bool)->bool`);
+   ("affine_dependent", `:(real^N->bool)->bool`);
+   ("conic", `:(real^A->bool)->bool`); ("convex", `:(real^A->bool)->bool`);
+   ("affine", `:(real^A->bool)->bool`);
+   ("closest_point", `:(real^A->bool)->real^A->real^A`);
+   ("from", `:num->num->bool`);
+   ("summable", `:(num->bool)->(num->real^A)->bool`);
+   ("infsum", `:(num->bool)->(num->real^A)->real^A`);
+   ("sums", `:(num->real^A)->real^A->(num->bool)->bool`);
+   ("homeomorphic", `:(real^A->bool)->(real^B->bool)->bool`);
+   ("homeomorphism",
+    `:(real^B->bool)#(real^A->bool)->(real^B->real^A)#(real^A->real^B)->bool`);
+   ("open_segment", `:real^A#real^A->real^A->bool`);
+   ("closed_segment", `:(real^A#real^A)list->real^A->bool`);
+   ("is_interval", `:(real^N->bool)->bool`);
+   ("closed_interval", `:(real^N#real^N)list->real^N->bool`);
+   ("open_interval", `:real^N#real^N->real^N->bool`);
+   ("diameter", `:(real^A->bool)->real`);
+   ("connected_component", `:(real^A->bool)->real^A->real^A->bool`);
+   ("uniformly_continuous_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("continuous_on", `:(real^B->real^A)->(real^B->bool)->bool`);
+   ("continuous", `:(B->real^A)->(B)net->bool`);
+   ("complete", `:(real^N->bool)->bool`); ("cauchy", `:(num->real^N)->bool`);
+   ("compact", `:(real^N->bool)->bool`);
+   ("bounded", `:(real^N->bool)->bool`); ("netlimit", `:(A)net->A`);
+   ("lim", `:(A)net->(A->real^B)->real^B`);
+   ("-->", `:(B->real^A)->real^A->(B)net->bool`);
+   ("eventually", `:(A->bool)->(A)net->bool`);
+   ("trivial_limit", `:(A)net->bool`);
+   ("in_direction", `:real^A->real^A->(real^A)net`);
+   ("within", `:(A)net->(A->bool)->(A)net`); ("sequentially", `:(num)net`);
+   ("at_infinity", `:(real^A)net`); ("at", `:real^A->(real^A)net`);
+   ("netord", `:(A)net->A->A->bool`); ("mk_net", `:(A->A->bool)->(A)net`);
+   ("frontier", `:(real^A->bool)->real^A->bool`);
+   ("closure", `:(real^A->bool)->real^A->bool`);
+   ("interior", `:(real^A->bool)->real^A->bool`);
+   ("limit_point_of", `:real^A->(real^A->bool)->bool`);
+   ("connected", `:(real^A->bool)->bool`);
+   ("cball", `:real^A#real->real^A->bool`);
+   ("ball", `:real^A#real->real^A->bool`);
+   ("euclidean", `:(real^A)topology`); ("closed", `:(real^N->bool)->bool`);
+   ("open", `:(real^A->bool)->bool`);
+   ("subtopology", `:(A)topology->(A->bool)->(A)topology`);
+   ("closed_in", `:(A)topology->(A->bool)->bool`);
+   ("topspace", `:(A)topology->A->bool`);
+   ("open_in", `:(A)topology->(A->bool)->bool`);
+   ("topology", `:((A->bool)->bool)->(A)topology`);
+   ("istopology", `:((A->bool)->bool)->bool`);
+   ("ITER", `:num->(A->A)->A->A`); ("frac", `:real->real`);
+   ("floor", `:real->real`); ("integer", `:real->bool`);
+   ("cross", `:real^3->real^3->real^3`);
+   ("rotoinversion_matrix", `:real^A^A->bool`);
+   ("rotation_matrix", `:real^A^A->bool`);
+   ("orthogonal_matrix", `:real^N^N->bool`);
+   ("orthogonal_transformation", `:(real^N->real^N)->bool`);
+   ("det", `:real^N^N->real`); ("trace", `:real^N^N->real`);
+   ("product", `:(A->bool)->(A->real)->real`); ("sign", `:(A->A)->real`);
+   ("evenperm", `:(A->A)->bool`); ("permutation", `:(A->A)->bool`);
+   ("swapseq", `:num->(A->A)->bool`); ("swap", `:A#A->A->A`);
+   ("inverse", `:(B->A)->A->B`); ("permutes", `:(A->A)->(A->bool)->bool`);
+   ("midpoint", `:real^A#real^A->real^A`);
+   ("between", `:real^A->real^A#real^A->bool`);
+   ("collinear", `:(real^A->bool)->bool`); ("infnorm", `:real^N->real`);
+   ("rank", `:real^M^N->num`); ("columnvector", `:real^N->real^1^N`);
+   ("rowvector", `:real^N->real^N^1`); ("dim", `:(real^A->bool)->num`);
+   ("independent", `:(real^A->bool)->bool`);
+   ("dependent", `:(real^A->bool)->bool`);
+   ("span", `:(real^A->bool)->real^A->bool`);
+   ("subspace", `:(real^A->bool)->bool`); ("drop", `:real^1->real`);
+   ("lift", `:real->real^1`); ("onorm", `:(real^M->real^N)->real`);
+   ("matrix", `:(real^M->real^N)->real^M^N`);
+   ("matrix_inv", `:real^N^M->real^M^N`); ("invertible", `:real^N^M->bool`);
+   ("columns", `:real^N^M->real^M->bool`);
+   ("rows", `:real^N^M->real^N->bool`); ("column", `:num->real^N^M->real^M`);
+   ("row", `:num->real^N^M->real^N`); ("transp", `:real^N^M->real^M^N`);
+   ("mat", `:num->real^N^M`);
+   ("vector_matrix_mul", `:real^M->real^N^M->real^N`);
+   ("matrix_vector_mul", `:real^N^M->real^N->real^M`);
+   ("matrix_mul", `:real^N^M->real^P^N->real^P^M`);
+   ("matrix_sub", `:real^N^M->real^N^M->real^N^M`);
+   ("matrix_add", `:real^N^M->real^N^M->real^N^M`);
+   ("matrix_neg", `:real^N^M->real^N^M`);
+   ("adjoint", `:(real^M->real^N)->real^N->real^M`);
+   ("bilinear", `:(real^A->real^B->real^C)->bool`);
+   ("linear", `:(real^M->real^N)->bool`);
+   ("orthogonal", `:real^A->real^A->bool`); ("basis", `:num->real^A`);
+   ("vsum", `:(A->bool)->(A->real^N)->real^N`);
+   ("distance", `:real^A#real^A->real`); ("vector_norm", `:real^A->real`);
+   ("dot", `:real^N->real^N->real`); ("vec", `:num->real^N`);
+   ("%", `:real->real^N->real^N`); ("vector_neg", `:real^N->real^N`);
+   ("vector_sub", `:real^N->real^N->real^N`);
+   ("vector_add", `:real^N->real^N->real^N`); ("sqrt", `:real->real`);
+   ("hull", `:((A->bool)->bool)->(A->bool)->A->bool`);
+   ("inf", `:(real->bool)->real`); ("sup", `:(real->bool)->real`);
+   ("superadmissible",
+    `:(A->A->bool)->((A->C)->B->bool)->(B->A)->((A->C)->B->C)->bool`);
+   ("tailadmissible",
+    `:(A->A->bool)->((A->B)->P->bool)->(P->A)->((A->B)->P->B)->bool`);
+   ("admissible",
+    `:(B->A->bool)->((B->C)->D->bool)->(D->A)->((B->C)->D->E)->bool`);
+   ("CASEWISE", `:((A->C)#(B->A->D))list->B->C->D`);
+   ("vector", `:(A)list->A^N`);
+   ("dest_auto_define_finite_type_3", `:3->num`);
+   ("mk_auto_define_finite_type_3", `:num->3`);
+   ("dest_auto_define_finite_type_2", `:2->num`);
+   ("mk_auto_define_finite_type_2", `:num->2`);
+   ("sndcart", `:A^(M,N)finite_sum->A^N`);
+   ("fstcart", `:A^(M,N)finite_sum->A^M`);
+   ("pastecart", `:A^M->A^N->A^(M,N)finite_sum`);
+   ("dest_finite_sum", `:(A,B)finite_sum->num`);
+   ("mk_finite_sum", `:num->(A,B)finite_sum`); ("lambda", `:(num->A)->A^B`);
+   ("$", `:B^A->num->B`); ("dest_cart", `:A^B->(B)finite_image->A`);
+   ("mk_cart", `:((B)finite_image->A)->A^B`);
+   ("dest_finite_image", `:(A)finite_image->num`);
+   ("finite_index", `:num->(A)finite_image`);
+   ("dimindex", `:(A->bool)->num`); ("sum", `:(A->bool)->(A->real)->real`);
+   ("nsum", `:(A->bool)->(A->num)->num`);
+   ("iterate", `:(B->B->B)->(A->bool)->(A->B)->B`);
+   ("support", `:(B->B->B)->(A->B)->(A->bool)->A->bool`);
+   ("monoidal", `:(A->A->A)->bool`); ("neutral", `:(A->A->A)->A`);
+   ("..", `:num->num->num->bool`); ("COUNTABLE", `:(A->bool)->bool`);
+   (">_c", `:(A->bool)->(B->bool)->bool`);
+   (">=_c", `:(A->bool)->(B->bool)->bool`);
+   ("=_c", `:(A->bool)->(B->bool)->bool`);
+   ("<_c", `:(A->bool)->(B->bool)->bool`);
+   ("<=_c", `:(A->bool)->(B->bool)->bool`);
+   ("PAIRWISE", `:(A->A->bool)->(A)list->bool`);
+   ("pairwise", `:(A->A->bool)->(A->bool)->bool`);
+   ("list_of_set", `:(A->bool)->(A)list`);
+   ("set_of_list", `:(A)list->A->bool`);
+   ("CROSS", `:(A->bool)->(B->bool)->A#B->bool`);
+   ("HAS_SIZE", `:(A->bool)->num->bool`); ("CARD", `:(A->bool)->num`);
+   ("ITSET", `:(A->B->B)->(A->bool)->B->B`);
+   ("FINREC", `:(A->B->B)->B->(A->bool)->B->num->bool`);
+   ("REST", `:(A->bool)->A->bool`); ("CHOICE", `:(A->bool)->A`);
+   ("BIJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("SURJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("INJ", `:(A->B)->(A->bool)->(B->bool)->bool`);
+   ("IMAGE", `:(A->B)->(A->bool)->B->bool`);
+   ("INFINITE", `:(A->bool)->bool`); ("FINITE", `:(A->bool)->bool`);
+   ("SING", `:(A->bool)->bool`); ("DISJOINT", `:(A->bool)->(A->bool)->bool`);
+   ("PSUBSET", `:(A->bool)->(A->bool)->bool`);
+   ("SUBSET", `:(A->bool)->(A->bool)->bool`);
+   ("DELETE", `:(A->bool)->A->A->bool`);
+   ("DIFF", `:(A->bool)->(A->bool)->A->bool`);
+   ("INTERS", `:((A->bool)->bool)->A->bool`);
+   ("INTER", `:(A->bool)->(A->bool)->A->bool`);
+   ("UNIONS", `:((A->bool)->bool)->A->bool`);
+   ("UNION", `:(A->bool)->(A->bool)->A->bool`); ("UNIV", `:A->bool`);
+   ("INSERT", `:A->(A->bool)->A->bool`); ("EMPTY", `:A->bool`);
+   ("SETSPEC", `:A->bool->A->bool`); ("GSPEC", `:(A->bool)->A->bool`);
+   ("IN", `:A->(A->bool)->bool`); ("num_gcd", `:num#num->num`);
+   ("num_coprime", `:num#num->bool`); ("num_mod", `:num->num->num->bool`);
+   ("num_divides", `:num->num->bool`); ("num_of_int", `:int->num`);
+   ("int_gcd", `:int#int->int`); ("int_coprime", `:int#int->bool`);
+   ("int_mod", `:int->int->int->bool`); ("int_divides", `:int->int->bool`);
+   ("real_mod", `:real->real->real->bool`);
+   ("==", `:A->A->(A->A->bool)->bool`); ("rem", `:int->int->int`);
+   ("div", `:int->int->int`); ("int_pow", `:int->num->int`);
+   ("int_min", `:int->int->int`); ("int_max", `:int->int->int`);
+   ("int_abs", `:int->int`); ("int_mul", `:int->int->int`);
+   ("int_sub", `:int->int->int`); ("int_add", `:int->int->int`);
+   ("int_neg", `:int->int`); ("int_of_num", `:num->int`);
+   ("int_gt", `:int->int->bool`); ("int_ge", `:int->int->bool`);
+   ("int_lt", `:int->int->bool`); ("int_le", `:int->int->bool`);
+   ("real_of_int", `:int->real`); ("int_of_real", `:real->int`);
+   ("is_int", `:real->bool`); ("DECIMAL", `:num->num->real`);
+   ("real_min", `:real->real->real`); ("real_max", `:real->real->real`);
+   ("real_div", `:real->real->real`); ("real_pow", `:real->num->real`);
+   ("real_abs", `:real->real`); ("real_gt", `:real->real->bool`);
+   ("real_ge", `:real->real->bool`); ("real_lt", `:real->real->bool`);
+   ("real_sub", `:real->real->real`); ("real_inv", `:real->real`);
+   ("real_le", `:real->real->bool`); ("real_mul", `:real->real->real`);
+   ("real_add", `:real->real->real`); ("real_neg", `:real->real`);
+   ("real_of_num", `:num->real`); ("dest_real", `:real->hreal#hreal->bool`);
+   ("mk_real", `:(hreal#hreal->bool)->real`);
+   ("treal_eq", `:hreal#hreal->hreal#hreal->bool`);
+   ("treal_inv", `:hreal#hreal->hreal#hreal`);
+   ("treal_le", `:hreal#hreal->hreal#hreal->bool`);
+   ("treal_mul", `:hreal#hreal->hreal#hreal->hreal#hreal`);
+   ("treal_add", `:hreal#hreal->hreal#hreal->hreal#hreal`);
+   ("treal_neg", `:hreal#hreal->hreal#hreal`);
+   ("treal_of_num", `:num->hreal#hreal`); ("hreal_inv", `:hreal->hreal`);
+   ("hreal_le", `:hreal->hreal->bool`);
+   ("hreal_mul", `:hreal->hreal->hreal`);
+   ("hreal_add", `:hreal->hreal->hreal`); ("hreal_of_num", `:num->hreal`);
+   ("dest_hreal", `:hreal->nadd->bool`);
+   ("mk_hreal", `:(nadd->bool)->hreal`); ("nadd_inv", `:nadd->nadd`);
+   ("nadd_rinv", `:nadd->num->num`); ("nadd_mul", `:nadd->nadd->nadd`);
+   ("nadd_add", `:nadd->nadd->nadd`); ("nadd_le", `:nadd->nadd->bool`);
+   ("nadd_of_num", `:num->nadd`); ("nadd_eq", `:nadd->nadd->bool`);
+   ("dest_nadd", `:nadd->num->num`); ("mk_nadd", `:(num->num)->nadd`);
+   ("is_nadd", `:(num->num)->bool`); ("dist", `:num#num->num`);
+   ("ASCII", `:bool->bool->bool->bool->bool->bool->bool->bool->char`);
+   ("_16756", `:bool->bool->bool->bool->bool->bool->bool->bool->char`);
+   ("_dest_char", `:char->(bool#bool#bool#bool#bool#bool#bool#bool)recspace`);
+   ("_mk_char", `:(bool#bool#bool#bool#bool#bool#bool#bool)recspace->char`);
+   ("ZIP", `:(A)list->(B)list->(A#B)list`);
+   ("ITLIST2", `:(A->B->C->C)->(A)list->(B)list->C->C`);
+   ("ASSOC", `:A->(A#B)list->B`); ("FILTER", `:(A->bool)->(A)list->(A)list`);
+   ("EL", `:num->(A)list->A`);
+   ("MAP2", `:(A->B->C)->(A)list->(B)list->(C)list`);
+   ("ALL2", `:(A->B->bool)->(A)list->(B)list->bool`);
+   ("MEM", `:A->(A)list->bool`); ("ITLIST", `:(A->B->B)->(A)list->B->B`);
+   ("EX", `:(A->bool)->(A)list->bool`); ("ALL", `:(A->bool)->(A)list->bool`);
+   ("NULL", `:(A)list->bool`); ("REPLICATE", `:num->A->(A)list`);
+   ("LAST", `:(A)list->A`); ("MAP", `:(A->B)->(A)list->(B)list`);
+   ("LENGTH", `:(A)list->num`); ("REVERSE", `:(A)list->(A)list`);
+   ("APPEND", `:(A)list->(A)list->(A)list`); ("TL", `:(A)list->(A)list`);
+   ("HD", `:(A)list->A`); ("ISO", `:(A->B)->(B->A)->bool`);
+   ("CONS", `:A->(A)list->(A)list`); ("NIL", `:(A)list`);
+   ("_dest_list", `:(A)list->(A)recspace`);
+   ("_mk_list", `:(A)recspace->(A)list`); ("SOME", `:A->(A)option`);
+   ("NONE", `:(A)option`); ("_dest_option", `:(A)option->(A)recspace`);
+   ("_mk_option", `:(A)recspace->(A)option`); ("OUTR", `:A+B->B`);
+   ("OUTL", `:A+B->A`); ("INR", `:B->A+B`); ("INL", `:A->A+B`);
+   ("_dest_sum", `:A+B->(A#B)recspace`); ("_mk_sum", `:(A#B)recspace->A+B`);
+   ("FNIL", `:num->A`); ("FCONS", `:A->(num->A)->num->A`);
+   ("CONSTR", `:num->A->(num->(A)recspace)->(A)recspace`);
+   ("BOTTOM", `:(A)recspace`); ("_dest_rec", `:(A)recspace->num->A->bool`);
+   ("_mk_rec", `:(num->A->bool)->(A)recspace`);
+   ("ZRECSPACE", `:(num->A->bool)->bool`); ("ZBOT", `:num->A->bool`);
+   ("ZCONSTR", `:num->A->(num->num->A->bool)->num->A->bool`);
+   ("INJP", `:(num->A->bool)->(num->A->bool)->num->A->bool`);
+   ("INJF", `:(num->num->A->bool)->num->A->bool`);
+   ("INJA", `:A->num->A->bool`); ("INJN", `:num->num->A->bool`);
+   ("NUMRIGHT", `:num->num`); ("NUMLEFT", `:num->bool`);
+   ("NUMSUM", `:bool->num->num`); ("NUMSND", `:num->num`);
+   ("NUMFST", `:num->num`); ("NUMPAIR", `:num->num->num`);
+   ("MEASURE", `:(A->num)->A->A->bool`); ("WF", `:(A->A->bool)->bool`);
+   ("minimal", `:(num->bool)->num`); ("MIN", `:num->num->num`);
+   ("MAX", `:num->num->num`); ("MOD", `:num->num->num`);
+   ("DIV", `:num->num->num`); ("FACT", `:num->num`); ("-", `:num->num->num`);
+   ("ODD", `:num->bool`); ("EVEN", `:num->bool`); (">", `:num->num->bool`);
+   (">=", `:num->num->bool`); ("<", `:num->num->bool`);
+   ("<=", `:num->num->bool`); ("EXP", `:num->num->num`);
+   ("*", `:num->num->num`); ("BIT1", `:num->num`); ("BIT0", `:num->num`);
+   ("+", `:num->num->num`); ("PRE", `:num->num`); ("NUMERAL", `:num->num`);
+   ("SUC", `:num->num`); ("_0", `:num`); ("dest_num", `:num->ind`);
+   ("mk_num", `:ind->num`); ("NUM_REP", `:ind->bool`); ("IND_0", `:ind`);
+   ("IND_SUC", `:ind->ind`); ("ONTO", `:(A->B)->bool`);
+   ("ONE_ONE", `:(A->B)->bool`); ("PASSOC", `:((A#B)#C->D)->A#B#C->D`);
+   ("UNCURRY", `:(A->B->C)->A#B->C`); ("CURRY", `:(A#B->C)->A->B->C`);
+   ("SND", `:A#B->B`); ("FST", `:A#B->A`); (",", `:A->B->A#B`);
+   ("REP_prod", `:A#B->A->B->bool`); ("ABS_prod", `:(A->B->bool)->A#B`);
+   ("mk_pair", `:A->B->A->B->bool`); ("_FUNCTION", `:(A->B->bool)->A->B`);
+   ("_MATCH", `:A->(A->B->bool)->B`);
+   ("_GUARDED_PATTERN", `:bool->bool->bool->bool`);
+   ("_UNGUARDED_PATTERN", `:bool->bool->bool`);
+   ("_SEQPATTERN", `:(A->B->bool)->(A->B->bool)->A->B->bool`);
+   ("GEQ", `:A->A->bool`); ("GABS", `:(A->bool)->A`); ("LET_END", `:A->A`);
+   ("LET", `:(A->B)->A->B`); ("one", `:1`); ("one_REP", `:1->bool`);
+   ("one_ABS", `:bool->1`); ("I", `:A->A`); ("o", `:(B->C)->(A->B)->A->C`);
+   ("COND", `:bool->A->A->A`); ("@", `:(A->bool)->A`);
+   ("_FALSITY_", `:bool`); ("?!", `:(A->bool)->bool`); ("~", `:bool->bool`);
+   ("F", `:bool`); ("\\/", `:bool->bool->bool`); ("?", `:(A->bool)->bool`);
+   ("!", `:(A->bool)->bool`); ("==>", `:bool->bool->bool`);
+   ("/\\", `:bool->bool->bool`); ("T", `:bool`); ("=", `:A->A->bool`)];;
+
+  let the_loaded_files =  ["flyspeck.ml"; "wlog_examples.ml"; "wlog.ml"; "real.ml"; "measure.ml";
+   "card.ml"; "wo.ml"; "geom.ml"; "transc.ml"; "canal.ml"; "complex.ml";
+   "integration.ml"; "analysis.ml"; "dimension.ml"; "convex.ml";
+   "topology.ml"; "iter.ml"; "floor.ml"; "cross.ml"; "determinants.ml";
+   "products.ml"; "permutations.ml"; "vectors.ml"; "misc.ml"; "database.ml";
+   "help.ml"; "define.ml"; "cart.ml"; "iter.ml"; "sets.ml"; "int.ml";
+   "calc_rat.ml"; "real.ml"; "realarith.ml"; "calc_int.ml"; "realax.ml";
+   "list.ml"; "ind-types.ml"; "grobner.ml"; "normalizer.ml"; "calc_num.ml";
+   "wf.ml"; "arith.ml"; "num.ml"; "pair.ml"; "recursion.ml"; "quot.ml";
+   "meson.ml"; "canon.ml"; "trivia.ml"; "class.ml"; "ind-defs.ml";
+   "theorems.ml"; "simp.ml"; "itab.ml"; "tactics.ml"; "drule.ml"; "bool.ml";
+   "equal.ml"; "printer.ml"; "parser.ml"; "preterm.ml"; "nets.ml";
+   "basics.ml"; "fusion.ml"; "lib.ml"; "sys.ml"];;
+
+  let the_overload_skeletons = [("real_interval", `:A`); ("segment", `:A`); ("interval", `:A`);
+   ("**", `:A->B->C`); ("norm", `:A->real`); ("gcd", `:A#A->A`);
+   ("coprime", `:A#A->bool`); ("mod", `:A->A->A->bool`);
+   ("divides", `:A->A->bool`); ("&", `:num->A`); ("min", `:A->A->A`);
+   ("max", `:A->A->A`); ("abs", `:A->A`); ("inv", `:A->A`);
+   ("pow", `:A->num->A`); ("--", `:A->A`); (">=", `:A->A->bool`);
+   (">", `:A->A->bool`); ("<=", `:A->A->bool`); ("<", `:A->A->bool`);
+   ("/", `:A->A->A`); ("*", `:A->A->A`); ("-", `:A->A->A`);
+   ("+", `:A->A->A`)];;
+
+  let the_interface =   [("vol", ("measure", `:(real^3->bool)->real`));
+   ("NULLSET", ("negligible", `:(real^3->bool)->bool`));
+   ("+", ("vector_add", `:real^N->real^N->real^N`));
+   ("-", ("vector_sub", `:real^N->real^N->real^N`));
+   ("--", ("vector_neg", `:real^N->real^N`));
+   ("norm", ("vector_norm", `:real^N->real`));
+   ("**", ("vector_matrix_mul", `:real^M->real^N^M->real^N`));
+   ("real_interval",
+    ("closed_real_interval", `:(real#real)list->real->bool`));
+   ("real_interval", ("open_real_interval", `:real#real->real->bool`));
+   ("+", ("real_add", `:real->real->real`));
+   ("-", ("real_sub", `:real->real->real`));
+   ("*", ("real_mul", `:real->real->real`));
+   ("/", ("real_div", `:real->real->real`));
+   ("<", ("real_lt", `:real->real->bool`));
+   ("<=", ("real_le", `:real->real->bool`));
+   (">", ("real_gt", `:real->real->bool`));
+   (">=", ("real_ge", `:real->real->bool`));
+   ("--", ("real_neg", `:real->real`));
+   ("pow", ("real_pow", `:real->num->real`));
+   ("inv", ("real_inv", `:real->real`));
+   ("abs", ("real_abs", `:real->real`));
+   ("max", ("real_max", `:real->real->real`));
+   ("min", ("real_min", `:real->real->real`));
+   ("&", ("real_of_num", `:num->real`));
+   ("mod", ("real_mod", `:real->real->real->bool`));
+   ("inv", ("complex_inv", `:real^2->real^2`));
+   ("pow", ("complex_pow", `:real^2->num->real^2`));
+   ("/", ("complex_div", `:real^2->real^2->real^2`));
+   ("*", ("complex_mul", `:real^2->real^2->real^2`));
+   ("-", ("vector_sub", `:real^2->real^2->real^2`));
+   ("+", ("vector_add", `:real^2->real^2->real^2`));
+   ("--", ("vector_neg", `:real^2->real^2`));
+   ("segment", ("closed_segment", `:(real^A#real^A)list->real^A->bool`));
+   ("segment", ("open_segment", `:real^A#real^A->real^A->bool`));
+   ("interval", ("closed_interval", `:(real^A#real^A)list->real^A->bool`));
+   ("interval", ("open_interval", `:real^A#real^A->real^A->bool`));
+   ("**", ("matrix_vector_mul", `:real^N^M->real^N->real^M`));
+   ("**", ("matrix_mul", `:real^N^M->real^P^N->real^P^M`));
+   ("-", ("matrix_sub", `:real^N^M->real^N^M->real^N^M`));
+   ("+", ("matrix_add", `:real^N^M->real^N^M->real^N^M`));
+   ("--", ("matrix_neg", `:real^N^M->real^N^M`));
+   ("dist", ("distance", `:real^N#real^N->real`));
+   ("+", ("+", `:num->num->num`)); ("-", ("-", `:num->num->num`));
+   ("*", ("*", `:num->num->num`)); ("<", ("<", `:num->num->bool`));
+   ("<=", ("<=", `:num->num->bool`)); (">", (">", `:num->num->bool`));
+   (">=", (">=", `:num->num->bool`));
+   ("divides", ("num_divides", `:num->num->bool`));
+   ("mod", ("num_mod", `:num->num->num->bool`));
+   ("coprime", ("num_coprime", `:num#num->bool`));
+   ("gcd", ("num_gcd", `:num#num->num`));
+   ("gcd", ("int_gcd", `:int#int->int`));
+   ("coprime", ("int_coprime", `:int#int->bool`));
+   ("mod", ("int_mod", `:int->int->int->bool`));
+   ("divides", ("int_divides", `:int->int->bool`));
+   ("&", ("int_of_num", `:num->int`));
+   ("min", ("int_min", `:int->int->int`));
+   ("max", ("int_max", `:int->int->int`)); ("abs", ("int_abs", `:int->int`));
+   ("pow", ("int_pow", `:int->num->int`)); ("--", ("int_neg", `:int->int`));
+   (">=", ("int_ge", `:int->int->bool`));
+   (">", ("int_gt", `:int->int->bool`));
+   ("<=", ("int_le", `:int->int->bool`));
+   ("<", ("int_lt", `:int->int->bool`));
+   ("*", ("int_mul", `:int->int->int`));
+   ("-", ("int_sub", `:int->int->int`));
+   ("+", ("int_add", `:int->int->int`));
+   ("&", ("hreal_of_num", `:num->hreal`));
+   ("<=>", ("=", `:bool->bool->bool`))];;
+
+  let the_types = [("net", 1); ("topology", 1); ("3", 0); ("2", 0); ("finite_sum", 2);
+   ("cart", 2); ("finite_image", 1); ("int", 0); ("real", 0); ("hreal", 0);
+   ("nadd", 0); ("char", 0); ("list", 1); ("option", 1); ("sum", 2);
+   ("recspace", 1); ("num", 0); ("ind", 0); ("prod", 2); ("1", 0);
+   ("bool", 0); ("fun", 2)];;
+  
+end;;
+
+module Snapshot_flyspeck_init_2010_02_11 : Snapshot_type = struct
+
+  let the_constants = Snapshot_v220_7_31_2009.the_constants;;
+  let the_loaded_files = Snapshot_v220_7_31_2009.the_loaded_files;;
+  let the_types = Snapshot_v220_7_31_2009.the_types;;
+  let the_overload_skeletons = Snapshot_v220_7_31_2009.the_overload_skeletons;;
+
+(*
+
+(* start with the hol-light snapshot v220_7_31_2009 then  *)
+prioritize_complex();; (* lowest priority *)
+prioritize_int();;
+prioritize_num();;
+prioritize_vector();;
+prioritize_real();;  (* highest priority *)
+
+*)
+
+  let the_interface = 
+  [("+", ("real_add", `:real->real->real`));
+   ("-", ("real_sub", `:real->real->real`));
+   ("*", ("real_mul", `:real->real->real`));
+   ("/", ("real_div", `:real->real->real`));
+   ("<", ("real_lt", `:real->real->bool`));
+   ("<=", ("real_le", `:real->real->bool`));
+   (">", ("real_gt", `:real->real->bool`));
+   (">=", ("real_ge", `:real->real->bool`));
+   ("--", ("real_neg", `:real->real`));
+   ("pow", ("real_pow", `:real->num->real`));
+   ("inv", ("real_inv", `:real->real`));
+   ("abs", ("real_abs", `:real->real`));
+   ("max", ("real_max", `:real->real->real`));
+   ("min", ("real_min", `:real->real->real`));
+   ("&", ("real_of_num", `:num->real`));
+   ("mod", ("real_mod", `:real->real->real->bool`));
+   ("+", ("vector_add", `:real^N->real^N->real^N`));
+   ("-", ("vector_sub", `:real^N->real^N->real^N`));
+   ("--", ("vector_neg", `:real^N->real^N`));
+   ("norm", ("vector_norm", `:real^N->real`));
+   ("**", ("vector_matrix_mul", `:real^M->real^N^M->real^N`));
+   ("+", ("+", `:num->num->num`)); ("-", ("-", `:num->num->num`));
+   ("*", ("*", `:num->num->num`)); ("<", ("<", `:num->num->bool`));
+   ("<=", ("<=", `:num->num->bool`)); (">", (">", `:num->num->bool`));
+   (">=", (">=", `:num->num->bool`));
+   ("divides", ("num_divides", `:num->num->bool`));
+   ("mod", ("num_mod", `:num->num->num->bool`));
+   ("coprime", ("num_coprime", `:num#num->bool`));
+   ("gcd", ("num_gcd", `:num#num->num`));
+   ("+", ("int_add", `:int->int->int`));
+   ("-", ("int_sub", `:int->int->int`));
+   ("*", ("int_mul", `:int->int->int`));
+   ("<", ("int_lt", `:int->int->bool`));
+   ("<=", ("int_le", `:int->int->bool`));
+   (">", ("int_gt", `:int->int->bool`));
+   (">=", ("int_ge", `:int->int->bool`)); ("--", ("int_neg", `:int->int`));
+   ("pow", ("int_pow", `:int->num->int`)); ("abs", ("int_abs", `:int->int`));
+   ("max", ("int_max", `:int->int->int`));
+   ("min", ("int_min", `:int->int->int`));
+   ("&", ("int_of_num", `:num->int`));
+   ("divides", ("int_divides", `:int->int->bool`));
+   ("mod", ("int_mod", `:int->int->int->bool`));
+   ("coprime", ("int_coprime", `:int#int->bool`));
+   ("gcd", ("int_gcd", `:int#int->int`));
+   ("inv", ("complex_inv", `:real^2->real^2`));
+   ("pow", ("complex_pow", `:real^2->num->real^2`));
+   ("/", ("complex_div", `:real^2->real^2->real^2`));
+   ("*", ("complex_mul", `:real^2->real^2->real^2`));
+   ("-", ("vector_sub", `:real^2->real^2->real^2`));
+   ("+", ("vector_add", `:real^2->real^2->real^2`));
+   ("--", ("vector_neg", `:real^2->real^2`));
+   ("vol", ("measure", `:(real^3->bool)->real`));
+   ("NULLSET", ("negligible", `:(real^3->bool)->bool`));
+   ("real_interval",
+    ("closed_real_interval", `:(real#real)list->real->bool`));
+   ("real_interval", ("open_real_interval", `:real#real->real->bool`));
+   ("segment", ("closed_segment", `:(real^A#real^A)list->real^A->bool`));
+   ("segment", ("open_segment", `:real^A#real^A->real^A->bool`));
+   ("interval", ("closed_interval", `:(real^A#real^A)list->real^A->bool`));
+   ("interval", ("open_interval", `:real^A#real^A->real^A->bool`));
+   ("**", ("matrix_vector_mul", `:real^N^M->real^N->real^M`));
+   ("**", ("matrix_mul", `:real^N^M->real^P^N->real^P^M`));
+   ("-", ("matrix_sub", `:real^N^M->real^N^M->real^N^M`));
+   ("+", ("matrix_add", `:real^N^M->real^N^M->real^N^M`));
+   ("--", ("matrix_neg", `:real^N^M->real^N^M`));
+   ("dist", ("distance", `:real^N#real^N->real`));
+   ("&", ("hreal_of_num", `:num->hreal`));
+   ("<=>", ("=", `:bool->bool->bool`))];;
+
+ end;;
+
diff --git a/development/thales/chaff/general/template_def.ml b/development/thales/chaff/general/template_def.ml
new file mode 100644 (file)
index 0000000..fea6aef
--- /dev/null
@@ -0,0 +1,163 @@
+(* ========================================================================== *)
+(* FLYSPECK - BOOK FORMALIZATION                                              *)
+(*                                                                            *)
+(* Author: Thomas C. Hales                                                    *)
+(* Date: Feb 7, 2010                                                          *)
+(* ========================================================================== *)
+
+
+(*
+Outputs to a file 
+a formatted HOL Light identifier, as a module with signature.
+The author and date information are added as comments.
+
+The file pathname is derived from the root directory, which can be set by the user,
+the lowercase of chapter string must match a subdirectory name precisely,
+and the identifier is used to create the file name.
+*)
+
+
+module type Template_hol_type = sig
+
+  type data =
+      {
+       identifier : string;
+       chapter : string;
+       author: string;
+       date:string;
+       code:string;
+       comments:string list;
+        needlist:string list;
+      }
+
+  val output_template_def : data -> unit 
+
+  val output_template_lemma : data -> unit
+
+  val set_root_dir : string-> unit  (* default is "/tmp" *)
+
+end;;
+
+(* 
+Example:  The following code creates a template identifier file 
+   "/tmp/Trigonometry/azim_def.hl",
+populated with the code from def1
+*)
+
+(*
+
+open Template_hol;;
+let example1() = 
+  let def1 = 
+    {identifier="azim";
+     chapter="Trigonometry";
+     author="Thomas C. Hales";
+     date="Feb 7, 2010";
+     code="<Insert HOL-Light code for theorem here>";
+     comments=["This is just a test!"];
+     needlist=["Multivariate/flyspeck.ml"];
+    } in
+ let _ = set_root_dir "/tmp" in
+   output_template_def def1;;
+example1();;
+
+*)
+
+module Template_hol : Template_hol_type = 
+struct
+
+  type data =
+      {
+       identifier : string;
+       chapter : string;
+       author: string;
+       date:string;
+       code:string;
+       comments: string list;
+       needlist:string list;
+      };;
+
+  (* Comments and Line Formatting *)
+
+  let sep= "/";;
+  let pad='=';;
+  let space=' ';;
+  let emptystring="";;
+
+  let unsplit d f = function
+    | (x::xs) ->  List.fold_left (fun s t -> s^d^(f t)) (f x) xs
+    | [] -> "";;
+
+  let join_lines  = unsplit "\n" (fun x-> x);;
+  let width = 80 - 6;;
+
+  let c_enclose s = "(* "^s^String.make (width - String.length s) space^" *)";;
+  let pad_line = (String.make width pad);;
+  let space_line = String.make width space;;
+
+  type opt = Def | Lemma;;
+  let label t = if t=Def then "Definition" else "Lemma";;
+  let ext t = if t=Def then "_def" else "";;
+
+  (* Content *)
+
+  let header t dat = 
+    let p = Printf.sprintf in
+      unsplit "\n" c_enclose [
+       pad_line;
+       p"FLYSPECK - BOOK FORMALIZATION";
+       space_line;
+       p"%s: %s" (label t) dat.identifier;
+       p"Chapter: %s" dat.chapter;
+       p"Author: %s" dat.author;
+       p"Date: %s" dat.date;
+       pad_line;
+      ];;
+
+  let more_comments dat = 
+   if (dat.comments =[]) then emptystring else
+   "(*\n"^(join_lines dat.comments)^"\n*)\n\n\n";;
+
+  let neededfiles dat = 
+       if (dat.needlist =[]) then emptystring else
+      (unsplit "\n" (fun s -> "flyspeck_needs \""^s^"\";;") dat.needlist)^"\n\n\n";;
+
+  let body dat = 
+    let p = Printf.sprintf in
+    let uc = String.capitalize (String.lowercase dat.identifier) in (* HOL Light parsing: cap first char only *)
+      join_lines [
+       p"module type %s_def_type = sig" uc;
+       p"  val %s : thm" dat.identifier;
+       "end;;\n\n";
+       neededfiles dat;
+       p"module %s : %s_def_type = struct\n" uc uc;
+       p" let %s = " dat.identifier;
+       dat.code;
+       "\nend;;\n";
+      ];;
+
+  (* Output *)
+
+  let rootdir =ref "/tmp";;
+  let set_root_dir s = (rootdir := s);;
+
+  let filename  t dat = (!rootdir)^sep^(String.lowercase dat.chapter)^sep^dat.identifier^(ext t)^".hl";;
+
+  let save_stringarray filename xs = 
+    let oc = open_out filename in
+      for i=0 to List.length xs -1
+      do
+       Pervasives.output_string oc (List.nth xs i ^ "\n");
+      done;
+      close_out oc;;
+
+  let output_template t dat = save_stringarray (filename t dat) 
+      [header t dat;"\n\n\n";more_comments dat;
+       body dat];;
+
+  let output_template_def dat = output_template Def dat;;
+  let output_template_lemma dat = output_template Lemma dat;;
+
+end;;
+
+
diff --git a/development/thales/chaff/general/xx.hl b/development/thales/chaff/general/xx.hl
new file mode 100644 (file)
index 0000000..f2b016f
--- /dev/null
@@ -0,0 +1,26 @@
+(* ========================================================================== *)
+(* FLYSPECK - BOOK FORMALIZATION                                              *)
+(*                                                                            *)
+(* Lemma: xx                                                                  *)
+(* Chapter: leg                                                               *)
+(* Author: Thomas C. Hales                                                    *)
+(* Date: 2010-02-09                                                           *)
+(* ========================================================================== *)
+
+
+
+
+
+module type Xx_def_type = sig
+  val xx : thm
+end;;
+
+
+module Xx : Xx_def_type = struct
+
+
+ let xx = 
+
+
+end;;
+
diff --git a/development/thales/chaff/load_path.ml b/development/thales/chaff/load_path.ml
new file mode 100644 (file)
index 0000000..d1d6d7a
--- /dev/null
@@ -0,0 +1,16 @@
+#use "hol.ml";;
+
+(* My customization *)
+
+load_path :=
+     ["/Users/thomashales/Desktop/flyspeck_google/source/inequalities/";
+      "/Users/thomashales/Desktop/flyspeck_google/source/text_formalization/"]
+        @ (!load_path);;
+
+load_path :=
+     ["/Users/thomashales/Desktop/flyspeck_google/flyspeck/inequalities/";
+      "/Users/thomashales/Desktop/flyspeck_google/flyspeck/text_formalization/"]
+        @ (!load_path);;
+
+
+needs "build.ml";;
diff --git a/development/thales/chaff/meson_edit.hl b/development/thales/chaff/meson_edit.hl
new file mode 100644 (file)
index 0000000..757f47c
--- /dev/null
@@ -0,0 +1,964 @@
+(* ========================================================================= *)
+(* Version of the MESON procedure a la PTTP. Various search options.         *)
+(*                                                                           *)
+(*       John Harrison, University of Cambridge Computer Laboratory          *)
+(*                                                                           *)
+(*            (c) Copyright, University of Cambridge 1998                    *)
+(*              (c) Copyright, John Harrison 1998-2007                       *)
+(* ========================================================================= *)
+
+needs "canon.ml";;
+
+
+module Meson_edit = struct 
+
+(* 
+Collect into a list 
+first-order formulas that occur in MESON_TAC calls.
+
+Notes:
+(1) This just does MESON_TAC, ASM_MESON_TAC is similar.
+(2) Right now, MESON_TAC runs twice.  Optimize to remove.
+
+sample usage:
+
+flyspeck_needs "../development/thales/holcode/meson_edit.hl";;
+let MESON_TAC=Meson_edit.MESON_SAVE_FOF_TAC;; (* redefine *)
+reneeds"trigonometry/trig2.hl";; (* run file with modified meson *)
+reneeds "../../hol_light/meson.ml";; (* restore MESON_TAC *)
+!Meson_edit.fof_list;;
+
+*)
+
+
+(* ------------------------------------------------------------------------- *)
+(* Some parameters controlling MESON behaviour.                              *)
+(* ------------------------------------------------------------------------- *)
+
+(*
+let meson_depth = ref false;;   (* Use depth not inference bound.            *)
+
+let meson_prefine = ref true;;  (* Use Plaisted's positive refinement.       *)
+
+let meson_dcutin = ref 1;;      (* Min size for d-and-c optimization cut-in. *)
+
+let meson_skew = ref 3;;        (* Skew proof bias (one side is <= n / skew) *)
+
+let meson_brand = ref false;;   (* Use Brand transformation                  *)
+
+let meson_split_limit = ref 8;; (* Limit of case splits before MESON proper  *)
+
+let meson_chatty = ref false;;  (* Old-style verbose MESON output            *)
+*)
+
+(* ------------------------------------------------------------------------- *)
+(* Prolog exception.                                                         *)
+(* ------------------------------------------------------------------------- *)
+(*
+exception Cut;;
+*)
+(* ------------------------------------------------------------------------- *)
+(* Shadow syntax for FOL terms in NNF. Functions and predicates have         *)
+(* numeric codes, and negation is done by negating the predicate code.       *)
+(* ------------------------------------------------------------------------- *)
+
+(*
+type fol_term = Fvar of int
+              | Fnapp of int * fol_term list;;
+
+type fol_atom = int * fol_term list;;
+
+type fol_form = Atom of fol_atom
+               | Conj of fol_form * fol_form
+               | Disj of fol_form * fol_form
+               | Forallq of int * fol_form;;
+
+(* ------------------------------------------------------------------------- *)
+(* Type for recording a MESON proof tree.                                    *)
+(* ------------------------------------------------------------------------- *)
+
+type fol_goal =
+  Subgoal of fol_atom * fol_goal list * (int * thm) *
+             int * (fol_term * int)list;;
+
+*)
+
+(* ------------------------------------------------------------------------- *)
+(* General MESON procedure, using assumptions and with settable limits.      *)
+(* ------------------------------------------------------------------------- *)
+
+  let offinc = 10000;;
+
+  let inferences = ref 0;;
+
+  (* ----------------------------------------------------------------------- *)
+  (* Like partition, but with short-circuiting for special situation.        *)
+  (* ----------------------------------------------------------------------- *)
+
+
+  let qpartition p m =
+    let rec qpartition l =
+      if l == m then raise Unchanged else
+      match l with
+        [] -> raise Unchanged
+      | (h::t) -> if p h then
+                    try let yes,no = qpartition t in h::yes,no
+                    with Unchanged -> [h],t
+                  else
+                    let yes,no = qpartition t in yes,h::no in
+    function l -> try qpartition l
+                  with Unchanged -> [],l ;;
+
+  let reset_vars,fol_of_var,hol_of_var =
+    let vstore = ref []
+    and gstore = ref []
+    and vcounter = ref 0 in
+    let inc_vcounter() =
+      let n = !vcounter in
+      let m = n + 1 in
+      if m >= offinc then failwith "inc_vcounter: too many variables" else
+      (vcounter := m; n) in
+    let reset_vars() = vstore := []; gstore := []; vcounter := 0 in
+    let fol_of_var v =
+      let currentvars = !vstore in
+      try assoc v currentvars with Failure _ ->
+      let n = inc_vcounter() in
+      vstore := (v,n)::currentvars; n in
+    let hol_of_var v =
+      try rev_assoc v (!vstore)
+      with Failure _ -> rev_assoc v (!gstore) in
+    let hol_of_bumped_var v =
+      try hol_of_var v with Failure _ ->
+      let v' = v mod offinc in
+      let hv' = hol_of_var v' in
+      let gv = genvar(type_of hv') in
+      gstore := (gv,v)::(!gstore); gv in
+    reset_vars,fol_of_var,hol_of_bumped_var ;;
+
+fol_of_var `x:real`;;
+hol_of_var 0;;
+
+  let reset_consts,fol_of_const,hol_of_const =
+    let false_tm = `F` in
+    let cstore = ref ([]:(term * int)list)
+    and ccounter = ref 2 in
+    let reset_consts() = cstore := [false_tm,1]; ccounter := 2 in
+    let fol_of_const c =
+      let currentconsts = !cstore in
+      try assoc c currentconsts with Failure _ ->
+      let n = !ccounter in
+      ccounter := n + 1; cstore := (c,n)::currentconsts; n in
+    let hol_of_const c = rev_assoc c (!cstore) in
+    reset_consts,fol_of_const,hol_of_const ;;
+
+fol_of_const `sin`;;
+hol_of_const 2;;
+
+
+  let rec fol_of_term env consts tm =
+    if is_var tm & not (mem tm consts) then
+      Fvar(fol_of_var tm)
+    else
+      let f,args = strip_comb tm in
+      if mem f env then failwith "fol_of_term: higher order" else
+      let ff = fol_of_const f in
+      Fnapp(ff,map (fol_of_term env consts) args) ;;
+
+fol_of_term [] [] `sin x pow 2 + cos x pow 2`;;
+hol_of_const 4;;
+
+  let fol_of_atom env consts tm =
+    let f,args = strip_comb tm in
+    if mem f env then failwith "fol_of_atom: higher order" else
+    let ff = fol_of_const f in
+    ff,map (fol_of_term env consts) args ;;
+
+fol_of_atom [] [] `cos x`;;
+
+  let fol_of_literal env consts tm =
+    try let tm' = dest_neg tm in
+        let p,a = fol_of_atom env consts tm' in
+        -p,a
+    with Failure _ -> fol_of_atom env consts tm ;;
+
+
+  let rec fol_of_form env consts tm =
+    try let v,bod = dest_forall tm in
+        let fv = fol_of_var v in
+        let fbod = fol_of_form (v::env) (subtract consts [v]) bod in
+        Forallq(fv,fbod)
+    with Failure _ -> try
+        let l,r = dest_conj tm in
+        let fl = fol_of_form env consts l
+        and fr = fol_of_form env consts r in
+        Conj(fl,fr)
+    with Failure _ -> try
+        let l,r = dest_disj tm in
+        let fl = fol_of_form env consts l
+        and fr = fol_of_form env consts r in
+        Disj(fl,fr)
+    with Failure _ ->
+        Atom(fol_of_literal env consts tm) ;;
+
+
+
+
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Further translation functions for HOL formulas.                         *)
+  (* ----------------------------------------------------------------------- *)
+
+  let rec hol_of_term tm =
+    match tm with
+      Fvar v -> hol_of_var v
+    | Fnapp(f,args) -> list_mk_comb(hol_of_const f,map hol_of_term args) ;;
+
+  let hol_of_atom (p,args) =
+    list_mk_comb(hol_of_const p,map hol_of_term args) ;;
+
+  let hol_of_literal (p,args) =
+    if p < 0 then mk_neg(hol_of_atom(-p,args))
+    else hol_of_atom (p,args) ;;
+
+  (* ----------------------------------------------------------------------- *)
+  (* Versions of shadow syntax operations with variable bumping.             *)
+  (* ----------------------------------------------------------------------- *)
+
+  let rec fol_free_in v tm =
+    match tm with
+      Fvar x -> x = v
+    | Fnapp(_,lis) -> exists (fol_free_in v) lis ;;
+
+  let rec fol_subst theta tm =
+    match tm with
+      Fvar v -> rev_assocd v theta tm
+    | Fnapp(f,args) ->
+          let args' = qmap (fol_subst theta) args in
+          if args' == args then tm else Fnapp(f,args') ;;
+
+  let fol_inst theta ((p,args) as at:fol_atom) =
+    let args' = qmap (fol_subst theta) args in
+    if args' == args then at else p,args' ;;
+
+  let rec fol_subst_bump offset theta tm =
+    match tm with
+      Fvar v -> if v < offinc then
+                 let v' = v + offset in
+                 rev_assocd v' theta (Fvar(v'))
+               else
+                 rev_assocd v theta tm
+    | Fnapp(f,args) ->
+          let args' = qmap (fol_subst_bump offset theta) args in
+          if args' == args then tm else Fnapp(f,args') ;;
+
+  let fol_inst_bump offset theta ((p,args) as at:fol_atom) =
+    let args' = qmap (fol_subst_bump offset theta) args in
+    if args' == args then at else p,args' ;;
+
+
+  let rec istriv env x t =
+    match t with
+      Fvar y -> y = x or
+                (try let t' = rev_assoc y env in istriv env x t'
+                 with Failure "find" -> false)
+    | Fnapp(f,args) -> exists (istriv env x) args & failwith "cyclic" ;;
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Main unification function, maintaining a "graph" instantiation.         *)
+  (* We implicitly apply an offset to variables in the second term, so this  *)
+  (* is not symmetric between the arguments.                                 *)
+  (* ----------------------------------------------------------------------- *)
+
+  let rec fol_unify offset tm1 tm2 sofar =
+    match tm1,tm2 with
+      Fnapp(f,fargs),Fnapp(g,gargs) ->
+          if f <> g then failwith "" else
+          itlist2 (fol_unify offset) fargs gargs sofar
+    | _,Fvar(x) ->
+         (let x' = x + offset in
+          try let tm2' = rev_assoc x' sofar in
+              fol_unify 0 tm1 tm2' sofar
+          with Failure "find" ->
+              if istriv sofar x' tm1 then sofar
+              else (tm1,x')::sofar)
+    | Fvar(x),_ ->
+         (try let tm1' = rev_assoc x sofar in
+              fol_unify offset tm1' tm2 sofar
+          with Failure "find" ->
+              let tm2' = fol_subst_bump offset [] tm2 in
+              if istriv sofar x tm2' then sofar
+              else (tm2',x)::sofar) ;;
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Test for equality under the pending instantiations.                     *)
+  (* ----------------------------------------------------------------------- *)
+
+  let rec fol_eq insts tm1 tm2 =
+    tm1 == tm2 or
+    match tm1,tm2 with
+      Fnapp(f,fargs),Fnapp(g,gargs) ->
+          f = g & forall2 (fol_eq insts) fargs gargs
+    | _,Fvar(x) ->
+         (try let tm2' = rev_assoc x insts in
+              fol_eq insts tm1 tm2'
+          with Failure "find" ->
+          try istriv insts x tm1 with Failure _ -> false)
+    | Fvar(x),_ ->
+         (try let tm1' = rev_assoc x insts in
+              fol_eq insts tm1' tm2
+          with Failure "find" ->
+          try istriv insts x tm2 with Failure _ -> false) ;;
+
+  let fol_atom_eq insts (p1,args1) (p2,args2) =
+    p1 = p2 & forall2 (fol_eq insts) args1 args2 ;;
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Cacheing continuations. Very crude, but it works remarkably well.       *)
+  (* ----------------------------------------------------------------------- *)
+
+  let cacheconts f =
+    let memory = ref [] in
+    fun (gg,(insts,offset,size) as input) ->
+      if exists (fun (_,(insts',_,size')) ->
+                     insts = insts' & (size <= size' or !meson_depth))
+          (!memory)
+      then failwith "cachecont"
+      else memory := input::(!memory); f input ;;
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Check ancestor list for repetition.                                     *)
+  (* ----------------------------------------------------------------------- *)
+
+  let checkan insts (p,a) ancestors =
+    let p' = -p in
+    let t' = (p',a) in
+    try let ours = assoc p' ancestors in
+        if exists (fun u -> fol_atom_eq insts t' (snd(fst u))) ours
+        then failwith "checkan"
+        else ancestors
+    with Failure "find" -> ancestors ;;
+
+ (* ----------------------------------------------------------------------- *)
+  (* Insert new goal's negation in ancestor clause, given refinement.        *)
+  (* ----------------------------------------------------------------------- *)
+
+  let insertan insts (p,a) ancestors =
+    let p' = -p in
+    let t' = (p',a) in
+    let ourancp,otheranc =
+      try remove (fun (pr,_) -> pr = p') ancestors
+      with Failure _ -> (p',[]),ancestors in
+    let ouranc = snd ourancp in
+    if exists (fun u -> fol_atom_eq insts t' (snd(fst u))) ouranc
+    then failwith "insertan: loop"
+    else (p',(([],t'),(0,TRUTH))::ouranc)::otheranc ;;
+
+  (* ----------------------------------------------------------------------- *)
+  (* Apply a multi-level "graph" instantiation.                              *)
+  (* ----------------------------------------------------------------------- *)
+
+  let rec fol_subst_partial insts tm =
+    match tm with
+      Fvar(v) -> (try let t = rev_assoc v insts in
+                      fol_subst_partial insts t
+                  with Failure "find" -> tm)
+    | Fnapp(f,args) -> Fnapp(f,map (fol_subst_partial insts) args) ;;
+
+  (* ----------------------------------------------------------------------- *)
+  (* Tease apart local and global instantiations.                            *)
+  (* At the moment we also force a full evaluation; should eliminate this.   *)
+  (* ----------------------------------------------------------------------- *)
+
+  let separate_insts offset oldinsts newinsts =
+    let locins,globins =
+      qpartition (fun (_,v) -> offset <= v) oldinsts newinsts in
+    if globins = oldinsts then
+      map (fun (t,x) -> fol_subst_partial newinsts t,x) locins,oldinsts
+    else
+      map (fun (t,x) -> fol_subst_partial newinsts t,x) locins,
+      map (fun (t,x) -> fol_subst_partial newinsts t,x) globins ;;
+
+  (* ----------------------------------------------------------------------- *)
+  (* Perform basic MESON expansion.                                          *)
+  (* ----------------------------------------------------------------------- *)
+
+  let meson_single_expand loffset rule ((g,ancestors),(insts,offset,size)) =
+    let (hyps,conc),tag = rule in
+    let allins = rev_itlist2 (fol_unify loffset) (snd g) (snd conc) insts in
+    let locin,globin = separate_insts offset insts allins in
+    let mk_ihyp h =
+      let h' = fol_inst_bump offset locin h in
+      h',checkan insts h' ancestors in
+    let newhyps =  map mk_ihyp hyps in
+    inferences := !inferences + 1;
+    newhyps,(globin,offset+offinc,size-length hyps) ;;
+
+  (* ----------------------------------------------------------------------- *)
+  (* Perform first basic expansion which allows continuation call.           *)
+  (* ----------------------------------------------------------------------- *)
+
+  let meson_expand_cont loffset rules state cont =
+    tryfind
+     (fun r -> cont (snd r) (meson_single_expand loffset r state)) rules;;
+
+  (* ----------------------------------------------------------------------- *)
+  (* Try expansion and continuation call with ancestor or initial rule.      *)
+  (* ----------------------------------------------------------------------- *)
+
+  let meson_expand rules ((g,ancestors),((insts,offset,size) as tup)) cont =
+    let pr = fst g in
+    let newancestors = insertan insts g ancestors in
+    let newstate = (g,newancestors),tup in
+    try if !meson_prefine & pr > 0 then failwith "meson_expand" else
+        let arules = assoc pr ancestors in
+        meson_expand_cont 0 arules newstate cont
+    with Cut -> failwith "meson_expand" | Failure _ ->
+        try let crules =
+              filter (fun ((h,_),_) -> length h <= size) (assoc pr rules) in
+            meson_expand_cont offset crules newstate cont
+        with Cut -> failwith "meson_expand"
+           | Failure _ -> failwith "meson_expand" ;;
+
+
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Simple Prolog engine organizing search and backtracking.                *)
+  (* ----------------------------------------------------------------------- *)
+
+  let expand_goal rules =
+    let rec expand_goal depth ((g,_),(insts,offset,size) as state) cont =
+      if depth < 0 then failwith "expand_goal: too deep" else
+      meson_expand rules state
+        (fun apprule (_,(pinsts,_,_) as newstate) ->
+            expand_goals (depth-1) newstate
+              (cacheconts(fun (gs,(newinsts,newoffset,newsize)) ->
+                 let locin,globin = separate_insts offset pinsts newinsts in
+                 let g' = Subgoal(g,gs,apprule,offset,locin) in
+                 if globin = insts & gs = [] then
+                   try cont(g',(globin,newoffset,size))
+                   with Failure _ -> raise Cut
+                 else
+                   try cont(g',(globin,newoffset,newsize))
+                   with Cut -> failwith "expand_goal"
+                      | Failure _ -> failwith "expand_goal")))
+
+    and expand_goals depth (gl,(insts,offset,size as tup)) cont =
+      match gl with
+        [] -> cont ([],tup)
+
+      | [g] -> expand_goal depth (g,tup) (fun (g',stup) -> cont([g'],stup))
+
+      | gl -> if size >= !meson_dcutin then
+                let lsize = size / (!meson_skew) in
+                let rsize = size - lsize in
+                let lgoals,rgoals = chop_list (length gl / 2) gl in
+                try expand_goals depth (lgoals,(insts,offset,lsize))
+                     (cacheconts(fun (lg',(i,off,n)) ->
+                         expand_goals depth (rgoals,(i,off,n + rsize))
+                           (cacheconts(fun (rg',ztup) -> cont (lg'@rg',ztup)))))
+                with Failure _ ->
+                    expand_goals depth (rgoals,(insts,offset,lsize))
+                      (cacheconts(fun (rg',(i,off,n)) ->
+                         expand_goals depth (lgoals,(i,off,n + rsize))
+                           (cacheconts (fun (lg',((_,_,fsize) as ztup)) ->
+                              if n + rsize <= lsize + fsize
+                              then failwith "repetition of demigoal pair"
+                              else cont (lg'@rg',ztup)))))
+              else
+                let g::gs = gl in
+                expand_goal depth (g,tup)
+                  (cacheconts(fun (g',stup) ->
+                      expand_goals depth (gs,stup)
+                        (cacheconts(fun (gs',ftup) -> cont(g'::gs',ftup))))) in
+
+    fun g maxdep maxinf cont ->
+      expand_goal maxdep (g,([],2 * offinc,maxinf)) cont ;;
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* With iterative deepening of inferences or depth.                        *)
+  (* ----------------------------------------------------------------------- *)
+
+  let solve_goal rules incdepth min max incsize =
+    let rec solve n g =
+      if n > max then failwith "solve_goal: Too deep" else
+      (if !meson_chatty & !verbose then
+        (Format.print_string
+          ((string_of_int (!inferences))^" inferences so far. "^
+              "Searching with maximum size "^(string_of_int n)^".");
+         Format.print_newline())
+       else if !verbose then
+        (Format.print_string(string_of_int (!inferences)^"..");
+         Format.print_flush())
+       else ());
+      try let gi =
+            if incdepth then expand_goal rules g n 100000 (fun x -> x)
+            else expand_goal rules g 100000 n (fun x -> x) in
+          (if !meson_chatty & !verbose then
+            (Format.print_string
+              ("Goal solved with "^(string_of_int (!inferences))^
+               " inferences.");
+             Format.print_newline())
+           else if !verbose then
+            (Format.print_string("solved at "^string_of_int (!inferences));
+             Format.print_newline())
+           else ());
+          gi
+      with Failure _ -> solve (n + incsize) g in
+    fun g -> solve min (g,[]) ;;
+
+  (* ----------------------------------------------------------------------- *)
+  (* Creation of tagged contrapositives from a HOL clause.                   *)
+  (* This includes any possible support clauses (1 = falsity).               *)
+  (* The rules are partitioned into association lists.                       *)
+  (* ----------------------------------------------------------------------- *)
+
+  let fol_of_hol_clauses =
+    let eqt (a1,(b1,c1)) (a2, (b2,c2)) =
+     ((a1 = a2) & (b1 = b2) & (equals_thm c1 c2)) in
+    let mk_negated (p,a) = -p,a in
+    let rec mk_contraposes n th used unused sofar =
+      match unused with
+        [] -> sofar
+      | h::t -> let nw = (map mk_negated (used @ t),h),(n,th) in
+                mk_contraposes (n + 1) th (used@[h]) t (nw::sofar) in
+    let fol_of_hol_clause th =
+      let lconsts = freesl (hyp th) in
+      let tm = concl th in
+      let hlits = disjuncts tm in
+      let flits = map (fol_of_literal [] lconsts) hlits in
+      let basics = mk_contraposes 0 th [] flits [] in
+      if forall (fun (p,_) -> p < 0) flits then
+        ((map mk_negated flits,(1,[])),(-1,th))::basics
+      else basics in
+    fun thms ->
+      let rawrules = itlist (union' eqt o fol_of_hol_clause) thms [] in
+      let prs = setify (map (fst o snd o fst) rawrules) in
+      let prules =
+        map (fun t -> t,filter ((=) t o fst o snd o fst) rawrules) prs in
+      let srules = sort (fun (p,_) (q,_) -> abs(p) <= abs(q)) prules in
+      srules ;;
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Optimize set of clauses; changing literal order complicates HOL stuff.  *)
+  (* ----------------------------------------------------------------------- *)
+
+  let optimize_rules =
+    let optimize_clause_order cls =
+      sort (fun ((l1,_),_) ((l2,_),_) -> length l1 <= length l2) cls in
+    map (fun (a,b) -> a,optimize_clause_order b) ;;
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Create a HOL contrapositive on demand, with a cache.                    *)
+  (* ----------------------------------------------------------------------- *)
+
+  let clear_contrapos_cache,make_hol_contrapos =
+    let DISJ_AC = AC DISJ_ACI
+    and imp_CONV = REWR_CONV(TAUT `a \/ b <=> ~b ==> a`)
+    and push_CONV =
+      GEN_REWRITE_CONV TOP_SWEEP_CONV
+       [TAUT `~(a \/ b) <=> ~a /\ ~b`; TAUT `~(~a) <=> a`]
+    and pull_CONV = GEN_REWRITE_CONV DEPTH_CONV
+       [TAUT `~a \/ ~b <=> ~(a /\ b)`]
+    and imf_CONV = REWR_CONV(TAUT `~p <=> p ==> F`) in
+    let memory = ref [] in
+    let clear_contrapos_cache() = memory := [] in
+    let make_hol_contrapos (n,th) =
+      let tm = concl th in
+      let key = (n,tm) in
+      try assoc key (!memory) with Failure _ ->
+      if n < 0 then
+        CONV_RULE (pull_CONV THENC imf_CONV) th
+      else
+        let djs = disjuncts tm in
+        let acth =
+          if n = 0 then th else
+          let ldjs,rdjs = chop_list n djs in
+          let ndjs = (hd rdjs)::(ldjs@(tl rdjs)) in
+          EQ_MP (DISJ_AC(mk_eq(tm,list_mk_disj ndjs))) th in
+        let fth =
+          if length djs = 1 then acth
+          else CONV_RULE (imp_CONV THENC push_CONV) acth in
+        (memory := (key,fth)::(!memory); fth) in
+    clear_contrapos_cache,make_hol_contrapos ;;
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Translate back the saved proof into HOL.                                *)
+  (* ----------------------------------------------------------------------- *)
+
+  let meson_to_hol =
+    let hol_negate tm =
+      try dest_neg tm with Failure _ -> mk_neg tm in
+    let merge_inst (t,x) current =
+      (fol_subst current t,x)::current in
+    let finish_RULE =
+      GEN_REWRITE_RULE I
+       [TAUT `(~p ==> p) <=> p`; TAUT `(p ==> ~p) <=> ~p`] in
+    let rec meson_to_hol insts (Subgoal(g,gs,(n,th),offset,locin)) =
+      let newins = itlist merge_inst locin insts in
+      let g' = fol_inst newins g in
+      let hol_g = hol_of_literal g' in
+      let ths = map (meson_to_hol newins) gs in
+      let hth =
+        if equals_thm th TRUTH then ASSUME hol_g else
+        let cth = make_hol_contrapos(n,th) in
+        if ths = [] then cth else MATCH_MP cth (end_itlist CONJ ths) in
+      let ith = PART_MATCH I hth hol_g in
+      finish_RULE (DISCH (hol_negate(concl ith)) ith) in
+    meson_to_hol ;;
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Create equality axioms for all the function and predicate symbols in    *)
+  (* a HOL term. Not very efficient (but then neither is throwing them into  *)
+  (* automated proof search!)                                                *)
+  (* ----------------------------------------------------------------------- *)
+
+  let create_equality_axioms =
+    let eq_thms = (CONJUNCTS o prove)
+     (`(x:A = x) /\
+       (~(x:A = y) \/ ~(x = z) \/ (y = z))`,
+      REWRITE_TAC[] THEN ASM_CASES_TAC `x:A = y` THEN
+      ASM_REWRITE_TAC[] THEN CONV_TAC TAUT) in
+    let imp_elim_CONV = REWR_CONV
+      (TAUT `(a ==> b) <=> ~a \/ b`) in
+    let eq_elim_RULE =
+      MATCH_MP(TAUT `(a <=> b) ==> b \/ ~a`) in
+    let veq_tm = rator(rator(concl(hd eq_thms))) in
+    let create_equivalence_axioms (eq,_) =
+      let tyins = type_match (type_of veq_tm) (type_of eq) [] in
+      map (INST_TYPE tyins) eq_thms in
+    let rec tm_consts tm acc =
+      let fn,args = strip_comb tm in
+      if args = [] then acc
+      else itlist tm_consts args (insert (fn,length args) acc) in
+    let rec fm_consts tm ((preds,funs) as acc) =
+      try fm_consts(snd(dest_forall tm)) acc with Failure _ ->
+      try fm_consts(snd(dest_exists tm)) acc with Failure _ ->
+      try let l,r = dest_conj tm in fm_consts l (fm_consts r acc)
+      with Failure _ -> try
+          let l,r = dest_disj tm in fm_consts l (fm_consts r acc)
+      with Failure _ -> try
+          let l,r = dest_imp tm in fm_consts l (fm_consts r acc)
+      with Failure _ -> try
+           fm_consts (dest_neg tm) acc with Failure _ ->
+      try let l,r = dest_eq tm in
+          if type_of l = bool_ty
+          then fm_consts r (fm_consts l acc)
+          else failwith "atomic equality"
+      with Failure _ ->
+      let pred,args = strip_comb tm in
+      if args = [] then acc else
+      insert (pred,length args) preds,itlist tm_consts args funs in
+    let create_congruence_axiom pflag (tm,len) =
+      let atys,rty = splitlist (fun ty -> let op,l = dest_type ty in
+                                          if op = "fun" then hd l,hd(tl l)
+                                          else fail())
+                               (type_of tm) in
+      let ctys = fst(chop_list len atys) in
+      let largs = map genvar ctys
+      and rargs = map genvar ctys in
+      let th1 = rev_itlist (C (curry MK_COMB)) (map (ASSUME o mk_eq)
+          (zip largs rargs)) (REFL tm) in
+      let th2 = if pflag then eq_elim_RULE th1 else th1 in
+      itlist (fun e th -> CONV_RULE imp_elim_CONV (DISCH e th)) (hyp th2) th2 in
+    fun tms -> let preds,funs = itlist fm_consts tms ([],[]) in
+               let eqs0,noneqs = partition
+                  (fun (t,_) -> is_const t & fst(dest_const t) = "=") preds in
+               if eqs0 = [] then [] else
+               let pcongs = map (create_congruence_axiom true) noneqs
+               and fcongs = map (create_congruence_axiom false) funs in
+               let preds1,_ =
+                 itlist fm_consts (map concl (pcongs @ fcongs)) ([],[]) in
+               let eqs1 = filter
+                 (fun (t,_) -> is_const t & fst(dest_const t) = "=") preds1 in
+               let eqs = union eqs0 eqs1 in
+               let equivs =
+                 itlist (union' equals_thm o create_equivalence_axioms)
+                        eqs [] in
+               equivs@pcongs@fcongs ;;
+
+  (* ----------------------------------------------------------------------- *)
+  (* Brand's transformation.                                                 *)
+  (* ----------------------------------------------------------------------- *)
+
+  let perform_brand_modification =
+    let rec subterms_irrefl lconsts tm acc =
+      if is_var tm or is_const tm then acc else
+      let fn,args = strip_comb tm in
+      itlist (subterms_refl lconsts) args acc
+    and subterms_refl lconsts tm acc =
+      if is_var tm then if mem tm lconsts then insert tm acc else acc
+      else if is_const tm then insert tm acc else
+      let fn,args = strip_comb tm in
+      itlist (subterms_refl lconsts) args (insert tm acc) in
+    let CLAUSIFY = CONV_RULE(REWR_CONV(TAUT `a ==> b <=> ~a \/ b`)) in
+    let rec BRAND tms th =
+      if tms = [] then th else
+      let tm = hd tms in
+      let gv = genvar (type_of tm) in
+      let eq = mk_eq(gv,tm) in
+      let th' = CLAUSIFY (DISCH eq (SUBS [SYM (ASSUME eq)] th))
+      and tms' = map (subst [gv,tm]) (tl tms) in
+      BRAND  tms' th' in
+    let BRAND_CONGS th =
+      let lconsts = freesl (hyp th) in
+      let lits = disjuncts (concl th) in
+      let atoms = map (fun t -> try dest_neg t with Failure _ -> t) lits in
+      let eqs,noneqs = partition
+        (fun t -> try fst(dest_const(fst(strip_comb t))) = "="
+                  with Failure _ -> false) atoms in
+      let acc = itlist (subterms_irrefl lconsts) noneqs [] in
+      let uts = itlist
+        (itlist (subterms_irrefl lconsts) o snd o strip_comb) eqs acc in
+      let sts = sort (fun s t -> not(free_in s t)) uts in
+      BRAND sts th in
+    let BRANDE th =
+      let tm = concl th in
+      let l,r = dest_eq tm in
+      let gv = genvar(type_of l) in
+      let eq = mk_eq(r,gv) in
+      CLAUSIFY(DISCH eq (EQ_MP (AP_TERM (rator tm) (ASSUME eq)) th)) in
+    let LDISJ_CASES th lth rth =
+      DISJ_CASES th (DISJ1 lth (concl rth)) (DISJ2 (concl lth) rth) in
+    let ASSOCIATE = CONV_RULE(REWR_CONV(GSYM DISJ_ASSOC)) in
+    let rec BRAND_TRANS th =
+      let tm = concl th in
+      try let l,r = dest_disj tm in
+          if is_eq l then
+            let lth = ASSUME l in
+            let lth1 = BRANDE lth
+            and lth2 = BRANDE (SYM lth)
+            and rth = BRAND_TRANS (ASSUME r) in
+            map (ASSOCIATE o LDISJ_CASES th lth1) rth @
+            map (ASSOCIATE o LDISJ_CASES th lth2) rth
+          else
+            let rth = BRAND_TRANS (ASSUME r) in
+            map (LDISJ_CASES th (ASSUME l)) rth
+      with Failure _ ->
+          if is_eq tm then [BRANDE th; BRANDE (SYM th)]
+          else [th] in
+    let find_eqs =
+      find_terms (fun t -> try fst(dest_const t) = "="
+                           with Failure _ -> false) in
+    let REFLEXATE ths =
+      let eqs = itlist (union o find_eqs o concl) ths [] in
+      let tys = map (hd o snd o dest_type o snd o dest_const) eqs in
+      let gvs = map genvar tys in
+      itlist (fun v acc -> (REFL v)::acc) gvs ths in
+    fun ths ->
+      if exists (can (find_term is_eq o concl)) ths then
+        let ths' = map BRAND_CONGS ths in
+        let ths'' = itlist (union' equals_thm o BRAND_TRANS) ths' [] in
+        REFLEXATE ths''
+      else ths ;;
+
+
+  (* ----------------------------------------------------------------------- *)
+  (* Push duplicated copies of poly theorems to match existing assumptions.  *)
+  (* ----------------------------------------------------------------------- *)
+
+  let POLY_ASSUME_TAC =
+    let rec uniq' eq =
+      fun l ->
+        match l with
+          x::(y::_ as t) -> let t' = uniq' eq t in
+                              if eq x y then t' else
+                              if t'==t then l else x::t'
+        | _ -> l in
+    let setify' le eq s = uniq' eq (sort le s) in
+    let rec grab_constants tm acc =
+      if is_forall tm or is_exists tm then grab_constants (body(rand tm)) acc
+      else if is_iff tm or is_imp tm or is_conj tm or is_disj tm then
+        grab_constants (rand tm) (grab_constants (lhand tm) acc)
+      else if is_neg tm then grab_constants (rand tm) acc
+      else union (find_terms is_const tm) acc in
+    let match_consts (tm1,tm2) =
+      let s1,ty1 = dest_const tm1
+      and s2,ty2 = dest_const tm2 in
+      if s1 = s2 then type_match ty1 ty2 []
+      else failwith "match_consts" in
+    let polymorph mconsts th =
+      let tvs = subtract (type_vars_in_term (concl th))
+                         (unions (map type_vars_in_term (hyp th))) in
+      if tvs = [] then [th] else
+      let pconsts = grab_constants (concl th) [] in
+      let tyins = mapfilter match_consts
+        (allpairs (fun x y -> x,y) pconsts mconsts) in
+      let ths' =
+        setify' (fun th th' -> dest_thm th <= dest_thm th')
+                equals_thm (mapfilter (C INST_TYPE th) tyins) in
+      if ths' = [] then
+        (warn true "No useful-looking instantiations of lemma"; [th])
+      else ths' in
+    let rec polymorph_all mconsts ths acc =
+      if ths = [] then acc else
+      let ths' = polymorph mconsts (hd ths) in
+      let mconsts' = itlist grab_constants (map concl ths') mconsts in
+      polymorph_all mconsts' (tl ths) (union' equals_thm ths' acc) in
+    fun ths (asl,w as gl) ->
+      let mconsts = itlist (grab_constants o concl o snd) asl [] in
+      let ths' = polymorph_all mconsts ths [] in
+      MAP_EVERY ASSUME_TAC ths' gl ;;
+
+  (* ----------------------------------------------------------------------- *)
+  (* Basic HOL MESON procedure.                                              *)
+  (* ----------------------------------------------------------------------- *)
+
+  let SIMPLE_MESON_REFUTE min max inc ths =
+    clear_contrapos_cache();
+    inferences := 0;
+    let old_dcutin = !meson_dcutin in
+    if !meson_depth then meson_dcutin := 100001 else ();
+    let ths' = if !meson_brand then perform_brand_modification ths
+               else ths @ create_equality_axioms (map concl ths) in
+    let rules = optimize_rules(fol_of_hol_clauses ths') in
+    let proof,(insts,_,_) =
+      solve_goal rules (!meson_depth) min max inc (1,[]) in
+    meson_dcutin := old_dcutin;
+    meson_to_hol insts proof ;;
+
+ let PREP_SIMPLE_MESON_REFUTE  ths =
+    clear_contrapos_cache();
+    inferences := 0;
+    let old_dcutin = !meson_dcutin in
+    if !meson_depth then meson_dcutin := 100001 else ();
+    let ths' = if !meson_brand then perform_brand_modification ths
+               else ths @ create_equality_axioms (map concl ths) in
+      optimize_rules(fol_of_hol_clauses ths') ;;
+
+  let CONJUNCTS_THEN' ttac cth =
+    ttac(CONJUNCT1 cth) THEN ttac(CONJUNCT2 cth) ;;
+
+  let PURE_MESON_TAC min max inc gl =
+    reset_vars(); reset_consts();
+    (FIRST_ASSUM CONTR_TAC ORELSE
+     W(ACCEPT_TAC o SIMPLE_MESON_REFUTE min max inc o map snd o fst)) gl ;;
+
+  let QUANT_BOOL_CONV =
+    PURE_REWRITE_CONV[FORALL_BOOL_THM; EXISTS_BOOL_THM; COND_CLAUSES;
+                      NOT_CLAUSES; IMP_CLAUSES; AND_CLAUSES; OR_CLAUSES;
+                      EQ_CLAUSES; FORALL_SIMP; EXISTS_SIMP] ;;
+
+  let rec SPLIT_TAC n g =
+    ((FIRST_X_ASSUM(CONJUNCTS_THEN' ASSUME_TAC) THEN SPLIT_TAC n) ORELSE
+     (if n > 0 then FIRST_X_ASSUM DISJ_CASES_TAC THEN SPLIT_TAC (n - 1)
+      else NO_TAC) ORELSE
+     ALL_TAC) g ;;
+
+(*
+  let SHORT_PREP_MESON_TAC  ths =
+    REFUTE_THEN ASSUME_TAC THEN
+    POLY_ASSUME_TAC (map GEN_ALL ths) THEN
+    W(MAP_EVERY(UNDISCH_TAC o concl o snd) o fst) THEN
+    SELECT_ELIM_TAC THEN
+    W(fun (asl,w) -> MAP_EVERY (fun v -> SPEC_TAC(v,v)) (frees w)) THEN
+    CONV_TAC(PRESIMP_CONV THENC
+             TOP_DEPTH_CONV BETA_CONV THENC
+             LAMBDA_ELIM_CONV THENC
+             CONDS_CELIM_CONV THENC
+             QUANT_BOOL_CONV) THEN
+    REPEAT(GEN_TAC ORELSE DISCH_TAC) THEN
+    REFUTE_THEN ASSUME_TAC ;;
+*)
+  let PREP_MESON_TAC  ths =
+    REFUTE_THEN ASSUME_TAC THEN
+    POLY_ASSUME_TAC (map GEN_ALL ths) THEN
+    W(MAP_EVERY(UNDISCH_TAC o concl o snd) o fst) THEN
+    SELECT_ELIM_TAC THEN
+    W(fun (asl,w) -> MAP_EVERY (fun v -> SPEC_TAC(v,v)) (frees w)) THEN
+    CONV_TAC(PRESIMP_CONV THENC
+             TOP_DEPTH_CONV BETA_CONV THENC
+             LAMBDA_ELIM_CONV THENC
+             CONDS_CELIM_CONV THENC
+             QUANT_BOOL_CONV) THEN
+    REPEAT(GEN_TAC ORELSE DISCH_TAC) THEN
+    REFUTE_THEN ASSUME_TAC THEN
+    RULE_ASSUM_TAC(CONV_RULE(NNF_CONV THENC SKOLEM_CONV)) THEN
+    REPEAT (FIRST_X_ASSUM CHOOSE_TAC) THEN
+    ASM_FOL_TAC THEN
+    SPLIT_TAC (!meson_split_limit) THEN
+    RULE_ASSUM_TAC(CONV_RULE(PRENEX_CONV THENC WEAK_CNF_CONV)) THEN
+    RULE_ASSUM_TAC(repeat
+     (fun th -> SPEC(genvar(type_of(fst(dest_forall(concl th))))) th)) THEN
+    REPEAT (FIRST_X_ASSUM (CONJUNCTS_THEN' ASSUME_TAC)) THEN
+    RULE_ASSUM_TAC(CONV_RULE(ASSOC_CONV DISJ_ASSOC)) THEN
+    REPEAT (FIRST_X_ASSUM SUBST_VAR_TAC);;
+
+
+
+
+let GEN_MESON_TAC =
+  fun min max step ths ->
+    PREP_MESON_TAC  ths THEN PURE_MESON_TAC min max step;;
+
+
+(* ------------------------------------------------------------------------- *)
+(* Common cases.                                                             *)
+(* ------------------------------------------------------------------------- *)
+
+let ASM_MESON_TAC = GEN_MESON_TAC 0 50 1;;
+
+let MESON_TAC ths = POP_ASSUM_LIST(K ALL_TAC) THEN ASM_MESON_TAC ths;;
+
+(* ------------------------------------------------------------------------- *)
+(* Also introduce a rule.                                                  *)
+(* ------------------------------------------------------------------------- *)
+
+let MESON ths tm = prove(tm,MESON_TAC ths);;
+
+(* MESON_PREP_TAC *)
+
+let fof_list = ref [];;
+      
+let MESON_SAVE_FOF_TAC thms (asl,g) = 
+  let (_,gs,_) =  PREP_MESON_TAC thms (asl,g) in
+  let g' = hd gs in
+  let fof = PREP_SIMPLE_MESON_REFUTE (map snd (fst g')) in
+  let _ = fof_list := fof :: !fof_list in
+    MESON_TAC thms (asl,g);;
+
+(* print first order formulas *)
+
+let rec print_fol_term tm  = match tm with
+    Fvar i -> print_string "Fvar("; print_int i; print_string ")"
+  |      Fnapp (i,fls) -> print_string "Fnapp ("; print_int i; 
+   print_string ", [";
+  do_list  (fun t -> print_fol_term t;print_string ";") fls; print_string "])";;
+
+let print_fol_atom (i,fls) = 
+  print_int i; print_string ", [";
+  do_list  (fun t -> print_fol_term t;print_string ";") fls; print_string "])";;
+
+let rec  print_fol_form fo = match fo with
+  | Atom a -> print_string "Atom("; print_fol_atom a; print_string ")"
+  | Conj(a,b) -> print_string "Conj("; print_fol_form a; print_string ","; print_fol_form b; print_string ")"
+  | Disj(a,b) -> print_string "Disj("; print_fol_form a; print_string ","; print_fol_form b; print_string ")"
+  | Forallq (i,f) -> print_string "Forallq("; print_int i; print_string ","; print_fol_form f; print_string ")";;
+
+let (print_dl:((fol_atom list * (int * fol_term list)) * (int * thm))->unit)=
+    fun ((fas,(i,fts)),(k,th)) ->
+      print_string "(";
+      do_list print_fol_atom fas; 
+      print_string ",("; print_int i;
+      print_string ","; do_list print_fol_term fts;
+      print_string "),("; print_int k;
+      print_string ","; print_thm th; print_string ")) ";;
+
+let print_data (i,dls) =
+  print_string "("; print_int i; print_string ",";
+  do_list print_dl dls; print_string ")\n\n";;
+
+
+
+end;;
diff --git a/development/thales/chaff/tactic.hl b/development/thales/chaff/tactic.hl
new file mode 100644 (file)
index 0000000..8ea81ed
--- /dev/null
@@ -0,0 +1,97 @@
+(*
+places:
+  goal, assumption list, input box with prompts, proof text, search results
+
+
+*)
+
+(*
+theorem searching -n NAME, -o omit, -r rewrite format, -s sort by length, -
+save search history and selected results., 
+
+*)
+
+(* Jordan from: 
+    eventually merge...  *)
+
+let rec type_set: (string*term) list  -> (term list*term) -> (term list*term)=
+  fun tinfo (acclist,utm) -> match acclist with
+    | [] -> (acclist,utm)
+    | (Var(s,_) as a)::rest ->
+         let a' = (assocd s tinfo a) in
+           if (a = a') then type_set tinfo (rest,utm)
+           else let inst = instantiate (term_match [] a a') in
+             type_set tinfo ((map inst rest),inst utm)
+    | _ -> failwith "type_set: variable expected"
+  ;;
+
+let has_stv t =
+  let typ = (type_vars_in_term t) in
+  can (find (fun ty -> (is_vartype ty) && ((dest_vartype ty).[0] = '?'))) typ;;
+
+let typeinfo (asl,w) =   
+  let freel = itlist (union o frees o concl o snd) asl (frees w) in
+  let pairup  = (function
+                  |Var(s,_) as t -> (s,t) 
+                  | _ -> failwith "typeinfo: unreachable state" ) in
+  map pairup freel;;
+
+let set_types_from_goal (asl,w)  =
+  let set_types tinfo t = snd (type_set tinfo ((frees t),t)) in
+    set_types (typeinfo(asl,w));;
+
+let TYPE_THEN: term  -> (term -> tactic) -> tactic =
+  fun t tac (asl,w) ->
+  let t' = set_types_from_goal(asl,w) t in
+    (warn ((has_stv t')) "TYPE_THEN: unresolved type variables");
+    tac t' (asl,w);;
+
+let TYPEL_THEN: term list -> (term list -> tactic) -> tactic =
+  fun t tac (asl,w) ->
+  let t' = map (set_types_from_goal(asl,w)) t in 
+    (warn ((can (find has_stv) t')) "TYPEL_THEN: unresolved type vars");
+     tac t' (asl,w);;
+
+help "ABBREV_TAC";;
+(* hightlight term, typeover abbrev *)
+let MK_ABBREV_TAC: term -> string -> goal -> goalstate = 
+  fun oldtext abbrev (asl,w) ->
+    let text = set_types_from_goal (asl,w) oldtext in
+  let abbrev' = mk_var(abbrev,(type_of text)) in
+   ABBREV_TAC (mk_eq (abbrev', text)) (asl,w);;
+
+help "ABS_TAC";;
+(* delete the lambda, or the bound variable *)
+
+help "ACCEPT_TAC";; (* ignore for now *)
+
+help "ALL_TAC";; (* ignore for now *)
+
+help "ANTE_RES_THEN";; (* ignore for now *)
+
+help "ANTS_TAC";;  (* delete ant of ant, subgoal button *)
+
+help "AP_TERM_TAC";;  (* delete f in f x = f y, either first or second instance *)
+
+help "AP_THM_TAC";;  (* delete x in f x = g x, either first or second *)
+
+help "ARITH_TAC";;  (* terminator, try if it is an arithmetic expression. *)
+
+help "ASM_CASES_TAC";;  (* needs a term u to split *)
+
+help "ASM_FOL_TAC";; (* ignore forever *)
+
+help "ASM_MESON_TAC";; (* terminator , option -a on MESON_TAC *)
+
+help "ASM_REWRITE_TAC";; (* option -a on REWRITE_TAC *)
+
+help "ASM_SIMP_TAC";; (* option -a on SIMP_TAC *)
+
+help "ASSUME_TAC";; (* needs theorem *)
+
+help "BETA_TAC";; (* delete lambda *)
+
+
+
+
+
diff --git a/development/thales/chaff/tactics.hl b/development/thales/chaff/tactics.hl
new file mode 100644 (file)
index 0000000..b54c9ce
--- /dev/null
@@ -0,0 +1,1395 @@
+(*
+Hales, tactics 
+*)
+
+(* 
+   A type conflict is defined as two terms in the same context with
+   the same string name and different types.  We search for type conflicts in the 
+   head of the current goal stack.
+*)
+let conflict () = 
+  let rec atoms tm = 
+    match tm with
+      | Var(_,_) -> [dest_var tm]
+      | Const(_,_) -> []
+      | Abs(bv,bod) -> dest_var bv :: atoms bod
+      | Comb(s,t) -> atoms s @ atoms t in
+  let atoml tml = itlist (union o atoms) tml [] in
+  let atomg (r,t) = atoml (t :: map (concl o snd) r) in
+  let rec atomgl r = match r with
+      [] -> []
+    | b::bs -> atomg b @ atomgl bs in
+  let atomc() = sort (<) (atomgl ((fun (_,x,_) -> x) (hd (!current_goalstack)))) in
+  let rec confl x acc = match x with
+      [] -> acc
+    | b::[] -> acc
+    | a::b::bs -> if ((fst a = fst b) && not(snd a = snd b) )
+      then (confl (b::bs) ((a,b)::acc)) else confl (b::bs) acc in
+  confl (atomc()) [];;
+
+(* ------------------------------------------------------------------ *)
+(* This bundles an interactive session into a proof. *)
+(* From jordan_curve/hol_ext/tactics_refine.ml *)
+(* ------------------------------------------------------------------ *)
+
+
+let (set_label,no_label,labeled) = 
+  let flag = ref false in
+  (fun () -> (flag:= true)),(fun ()-> (flag:=false)),(fun () -> !flag);;
+
+let LABEL_ALL_TAC:tactic = 
+ let mk_label avoid =
+  let rec mk_one_label i avoid  = 
+    let label = "Z-"^(string_of_int i) in
+      if not(mem label avoid) then label else mk_one_label (i+1) avoid in
+    mk_one_label 0 avoid in
+ let update_label i asl = 
+  let rec f_at_i f j =
+    function [] -> []
+      | a::b -> if (j=0) then (f a)::b else a::(f_at_i f (j-1) b) in
+  let avoid = map fst asl in
+  let current = el i avoid in
+  let new_label = mk_label avoid in
+  if (String.length current > 0) then asl else 
+    f_at_i (fun (_,y) -> (new_label,y) ) i asl in
+  fun (asl,w) ->  
+    let aslp = ref asl in
+    (for i=0 to ((length asl)-1) do (aslp := update_label i !aslp) done;
+    (ALL_TAC (!aslp,w)));;
+
+(* global_var *)
+let (EVERY_STEP_TAC:tactic ref) = ref ALL_TAC;;
+
+let (e:tactic ->goalstack) =  
+   fun tac -> refine(by(VALID 
+   (if labeled() then (tac THEN (!EVERY_STEP_TAC)) THEN LABEL_ALL_TAC
+   else tac)));;
+
+let has_stv t = 
+  let typ = (type_vars_in_term t) in
+  can (find (fun ty -> (is_vartype ty) && ((dest_vartype ty).[0] = '?'))) typ;;
+
+let prove_by_refinement(t,(tacl:tactic list)) = 
+  if (length (frees t) > 0) 
+    then failwith "prove_by_refinement: free vars" else
+  if (has_stv t) 
+    then failwith "prove_by_refinement: has stv" else
+  let gstate = mk_goalstate ([],t) in
+  let _,sgs,just = rev_itlist 
+    (fun tac gs -> by 
+       (if labeled() then (tac THEN 
+         (!EVERY_STEP_TAC) THEN LABEL_ALL_TAC ) else tac) gs)
+     tacl gstate in
+  let th = if sgs = [] then just null_inst []
+  else failwith "BY_REFINEMENT_PROOF: Unsolved goals" in
+  let t' = concl th in
+  if t' = t then th else
+  try EQ_MP (ALPHA t' t) th
+  with Failure _ -> failwith "prove_by_refinement: generated wrong theorem";;
+
+(* ------------------------------------------------------------------------- *)
+(* A printer for goals etc.                                                  *)
+(* ------------------------------------------------------------------------- *)
+
+(* had (rev asl) in this method.  I don't want to reverse the list *)
+
+let save_hashstring,mem_hashstring,remove_hashstring,find_hashstring,memhash_of_string = 
+  let saved_hashstring = 
+    ref ((Hashtbl.create 300):(string,int) Hashtbl.t) in
+(fun string ->
+    Hashtbl.add !saved_hashstring (string) (hash_of_string string)),
+(fun  s -> Hashtbl.mem !saved_hashstring s),
+(fun  s -> Hashtbl.remove !saved_hashstring s),
+(fun s-> Hashtbl.find !saved_hashstring s),
+(fun s->if not(mem_hashstring s) then (save_hashstring s) ;
+   find_hashstring s);;
+
+let hash_of_string = 
+  let q = 1223 in
+  let p = 8831 in
+  let hashll = itlist (fun x y -> (int_of_char (String.get x 0) + q*y) mod p) in
+  fun s ->
+    hashll (explode s) 0;;
+
+let hash_of_type = 
+  let q = [863;941;1069;1151; 9733]  in (* some primes *)
+  let p n = List.nth q n in
+  let red n = n mod p 4 in
+  let m s = memhash_of_string s in
+  let rec hashl v = itlist (fun x y -> red(hasht x + p 3*y))  v 0 and
+    hasht v = match v with 
+    | Tyvar s -> red (p 0*m s + p 1) 
+    | Tyapp (s,tlt) -> let h = m s in
+               let h2 = red (h*h)  in
+          red (p 2*h2 + hashl tlt )  in
+  hasht;;
+
+(* 
+make hash_of_term constant on alpha-equivalence classes of
+terms 
+
+based on jordan_curve/hol_ext/tactics_fix.ml
+*)
+
+let hash_of_term =  (* q = list of primes *)
+  let q =  [ 9887 ;1291; 1373; 1451; 1511; 1583; 1657; 1733; 1811] in
+  let p n = List.nth q n in
+  let red n = 100+(n mod p 0) in
+  let sq n = red (n*n) in
+  let ren level v =  ("??_"^(string_of_int level),type_of v)  in
+  let m s = memhash_of_string s in
+  let ty s = hash_of_type s in
+  let hh n s t = red (p n * m s +  ty t) in
+  let hhh ht level e n i j = red(p n * sq (ht level e i) + p (n+1) * (ht level e j) + p (n+2)) in
+  let rec ht  level e u = match u with
+    | Var(s,t) -> let (s',t') = assocd (s,t) e (s,t) in hh 1 s' t'
+    | Const(s,t) -> hh 2 s t
+    | Comb (s,t) -> hhh ht level e 3 s t
+    | Abs(s,t) -> hhh ht (level+1) ((dest_var s,ren level s)::e) 6 s t
+  in ht 0 [] ;;
+
+
+(* printing *)
+
+let print_hyp n (s,th) =
+  open_hbox();
+  print_string " ";
+  print_as 4 (string_of_int (hash_of_term (concl th)));
+  print_string " [";
+  print_qterm (concl th);
+  print_string "]";
+  (if not (s = "") then (print_string (" ("^s^")")) else ());
+  close_box();
+  print_newline();;
+
+let rec print_hyps n asl =
+  if asl = [] then () else
+  (print_hyp n (hd asl);
+   print_hyps (n + 1) (tl asl));;
+
+let (print_goal_hashed:goal->unit) =
+  fun (asl,w) ->
+    print_newline();
+    if asl <> [] then (print_hyps 0 (asl); print_newline()) else ();
+    print_qterm w; print_newline();;
+
+let (print_goalstate_hashed:int->goalstate->unit) =
+  fun k gs -> let (_,gl,_) = gs in
+              let n = length gl in
+              let s = if n = 0 then "No subgoals" else
+                        (string_of_int k)^" subgoal"^(if k > 1 then "s" else "")
+                     ^" ("^(string_of_int n)^" total)" in
+              print_string s; print_newline();
+              if gl = [] then () else
+              do_list (print_goal_hashed o C el gl) (rev(0 -- (k-1)));;
+
+let (print_goalstack_hashed:goalstack->unit) =
+  fun (l) ->
+    if l = [] then print_string "Empty goalstack"
+    else if tl l = [] then
+      let (_,gl,_ as gs) = hd l in
+      print_goalstate_hashed 1 gs
+    else
+      let (_,gl,_ as gs) = hd l
+      and (_,gl0,_) = hd(tl l) in
+      let p = length gl - length gl0 in
+      let p' = if p < 1 then 1 else p + 1 in
+      print_goalstate_hashed p' gs;;
+
+#install_printer print_goal_hashed;;
+#install_printer print_goalstack_hashed;;
+
+
+(* ------------------------------------------------------------------ *)
+(* MORE RECENT ADDITIONS *)
+(* ------------------------------------------------------------------ *)
+
+
+
+(* abbrev_type copied from definitions_group.ml *)
+
+let pthm = prove_by_refinement(
+  `(\ (x:A) .T) (@(x:A). T)`,
+  [BETA_TAC]);;
+
+(*
+  
+let abbrev_type ty s = let (a,b) = new_basic_type_definition s
+   ("mk_"^s,"dest_"^s) 
+   (INST_TYPE [ty,`:A`] pthm) in
+   let abst t = list_mk_forall ((frees t), t) in
+   let a' = abst (concl a) in
+   let b' = abst (rhs (concl b)) in 
+   (
+   prove_by_refinement(a',[REWRITE_TAC[a]]),
+   prove_by_refinement(b',[REWRITE_TAC[GSYM b]]));;
+
+*)
+
+(* ------------------------------------------------------------------ *)
+(* KILL IN *)
+(* ------------------------------------------------------------------ *)
+
+let un = REWRITE_RULE[IN];;
+
+(* ------------------------------------------------------------------ *)
+(* Nonfunctional Experiment *)
+(* ------------------------------------------------------------------ *)
+
+let goal=0;;
+let first=1;;
+let last=99;;
+let all=55;;
+
+type form =  Existential | Universal | Conjunction | Disjunction | Lambda | Equality | Unknown;;
+
+let form tm = if (is_forall tm) then Existential else Existential;;
+
+(* break down *)
+
+let br i  = match i with
+   0 -> true
+  | 1 -> false;;
+
+(* insert *)
+
+let in i = match i with
+  0 -> true;;
+
+(* combine *)
+
+(* ------------------------------------------------------------------ *)
+(* some general tactics *)
+(* ------------------------------------------------------------------ *)
+
+
+let SUBCONJ_TAC = 
+  MATCH_MP_TAC (TAUT `A /\ (A ==>B) ==> (A /\ B)`) THEN CONJ_TAC;;
+
+let PROOF_BY_CONTR_TAC = 
+  MATCH_MP_TAC (TAUT `(~A ==> F) ==> A`) THEN DISCH_TAC;;
+
+
+
+(* ------------------------------------------------------------------ *)
+(* some general tactics *)
+(* ------------------------------------------------------------------ *)
+
+(* before adding assumption to hypothesis list, cleanse it
+   of unnecessary conditions *)
+
+
+let CLEAN_ASSUME_TAC th = 
+   MP_TAC th THEN ASM_REWRITE_TAC[] THEN DISCH_TAC;;
+
+let CLEAN_THEN th ttac =
+   MP_TAC th THEN ASM_REWRITE_TAC[] THEN DISCH_THEN ttac;;
+
+(* looks for a hypothesis by matching a subterm *)
+let (UNDISCH_FIND_TAC: term -> tactic) =
+ fun tm (asl,w) -> 
+   let p = can (term_match[] tm)  in
+   try let sthm,_ = remove 
+     (fun (_,asm) -> can (find_term p) (concl ( asm))) asl in
+     UNDISCH_TAC (concl (snd sthm)) (asl,w)
+   with Failure _ -> failwith "UNDISCH_FIND_TAC";;
+
+let (UNDISCH_FIND_THEN: term -> thm_tactic -> tactic) =
+ fun tm ttac (asl,w) -> 
+   let p = can (term_match[] tm)  in
+   try let sthm,_ = remove 
+     (fun (_,asm) -> can (find_term p) (concl ( asm))) asl in
+     UNDISCH_THEN (concl (snd sthm)) ttac (asl,w) 
+   with Failure _ -> failwith "UNDISCH_FIND_TAC";;
+
+(* ------------------------------------------------------------------ *)
+(* NAME_CONFLICT_TAC : eliminate name conflicts in a term *)
+(* ------------------------------------------------------------------ *)
+
+let relabel_bound_conv tm = 
+ let rec vars_and_constants tm acc = 
+   match tm with
+    | Var _ -> tm::acc
+    | Const _ -> tm::acc
+    | Comb(a,b) -> vars_and_constants b (vars_and_constants a acc)
+    | Abs(a,b) -> a::(vars_and_constants b acc) in
+ let relabel_bound tm = 
+   match tm with
+    | Abs(x,t) ->
+       let avoids = gather ((!=) x) (vars_and_constants tm []) in
+        let x' = mk_primed_var avoids x in
+        if (x=x') then failwith "relabel_bound" else (alpha x' tm)
+    | _ -> failwith "relabel_bound" in
+ DEPTH_CONV (fun t -> ALPHA t (relabel_bound t)) tm;;
+
+(* example *)
+let _ = 
+  let bad_term = mk_abs (`x:bool`,`(x:num)+1=2`) in
+  relabel_bound_conv bad_term;;
+
+let NAME_CONFLICT_CONV = relabel_bound_conv;;
+
+let NAME_CONFLICT_TAC =  CONV_TAC (relabel_bound_conv);;
+
+(* renames  given bound variables *)
+let alpha_conv env tm = ALPHA tm (deep_alpha env tm);;
+
+(* replaces given alpha-equivalent terms with- the term itself *)
+let unify_alpha_tac = SUBST_ALL_TAC o REFL;;
+
+let rec get_abs tm acc = match tm with 
+   Abs(u,v) -> get_abs v (tm::acc)
+  |Comb(u,v) -> get_abs u (get_abs v acc)
+  |_ -> acc;;
+
+(* for purposes such as sorting, it helps if ALL ALPHA-equiv
+   abstractions are replaced by equal abstractions *)
+let (alpha_tac:tactic) =
+  fun  (asl,w' ) ->
+  EVERY (map unify_alpha_tac (get_abs w' [])) (asl,w');;
+
+(* ------------------------------------------------------------------ *)
+(* SELECT ELIMINATION.
+   SELECT_TAC should work whenever there is a single predicate selected. 
+   Something more sophisticated might be needed when there 
+   is (@)A and (@)B
+   in the same formula. 
+   Useful for proving statements such as  `1 + (@x. (x=3)) = 4` *)
+(* ------------------------------------------------------------------ *)
+
+(* spec form of SELECT_AX *)
+let select_thm select_fn select_exist =
+  BETA_RULE (ISPECL [select_fn;select_exist] 
+             SELECT_AX);;
+
+(* example *)
+select_thm 
+    `\m. (X:num->bool) m /\ (!n. X n ==> m <=| n)` `n:num`;;
+
+let SELECT_EXIST = prove_by_refinement(
+  `!(P:A->bool) Q. (?y. P y) /\ (!t. (P t ==> Q t)) ==> Q ((@) P)`,
+  (* {{{ proof *)\r\r  [\r  REPEAT GEN_TAC;\r  DISCH_ALL_TAC;\r  UNDISCH_FIND_TAC `(?)`;\r  DISCH_THEN CHOOSE_TAC;\r  ASSUME_TAC (ISPECL[`P:(A->bool)`;`y:A`] SELECT_AX);\r  ASM_MESON_TAC[];\r  ]);;\r\r  (* }}} *)
+
+let SELECT_THM = prove_by_refinement(
+  `!(P:A->bool) Q. (((?y. P y) ==> (!t. (P t ==> Q t))) /\ ((~(?y. P y)) ==> 
+     (!t. Q t))) ==> Q ((@) P)`,
+  (* {{{ proof *)\r  [\r  MESON_TAC[SELECT_EXIST];\r  ]);;\r  (* }}} *)
+
+let SELECT_TAC  = 
+  (* explicitly pull apart the clause Q((@) P), 
+     because MATCH_MP_TAC isn't powerful
+     enough to do this by itself. *)
+  let unbeta = prove(
+  `!(P:A->bool) (Q:A->bool). (Q ((@) P)) = (\t. Q t) ((@) P)`,MESON_TAC[]) in
+  let unbeta_tac = CONV_TAC (HIGHER_REWRITE_CONV[unbeta] true) in
+  unbeta_tac THEN (MATCH_MP_TAC SELECT_THM) THEN BETA_TAC THEN CONJ_TAC 
+   THENL[
+     (DISCH_THEN (fun t-> ALL_TAC)) THEN GEN_TAC; 
+     DISCH_TAC THEN GEN_TAC];;
+
+(* EXAMPLE:
+
+# g `(R:A->bool) ((@) S)`;;
+val it : Core.goalstack = 1 subgoal (1 total)
+
+`R ((@) S)`
+
+# e SELECT_TAC ;;
+val it : Core.goalstack = 2 subgoals (2 total)
+
+ 0 [`~(?y. S y)`]
+
+`R t`
+
+`S t ==> R t`
+
+*)
+
+
+(* ------------------------------------------------------------------ *)
+(* TYPE_THEN and TYPEL_THEN  calculate the types of the terms supplied
+   in a proof, avoiding the hassle of working them out by hand.
+   It locates the terms among the free variables in the goal.
+   Ambiguious if a free variables have name conflicts. 
+
+   Now TYPE_THEN handles general terms.
+*)
+(* ------------------------------------------------------------------ *)
+
+
+let rec type_set: (string*term) list  -> (term list*term) -> (term list*term)=
+  fun typinfo (acclist,utm) -> match acclist with
+    | [] -> (acclist,utm)
+    | (Var(s,_) as a)::rest ->
+        let a' = (assocd s typinfo a) in
+          if (a = a') then type_set typinfo (rest,utm) 
+          else let inst = instantiate (term_match [] a a') in
+            type_set typinfo ((map inst rest),inst utm)
+    | _ -> failwith "type_set: variable expected"
+  ;;
+
+let has_stv t = 
+  let typ = (type_vars_in_term t) in
+  can (find (fun ty -> (is_vartype ty) && ((dest_vartype ty).[0] = '?'))) typ;;
+
+
+let TYPE_THEN: term  -> (term -> tactic) -> tactic = 
+  fun t (tac:term->tactic) (asl,w) ->
+  let avoids = itlist (union o frees o concl o snd) asl
+                               (frees w) in
+  let strip  = fun t-> (match t with 
+       |Var(s,_) -> (s,t) | _ -> failwith "TYPE_THEN" ) in
+  let typinfo = map strip avoids in
+  let t' = (snd (type_set typinfo ((frees t),t))) in
+    (warn ((has_stv t')) "TYPE_THEN: unresolved type variables");
+    tac t' (asl,w);;
+
+(* this version must take variables *)
+let TYPEL_THEN: term list -> (term list -> tactic) -> tactic = 
+  fun t (tac:term list->tactic) (asl,w) ->
+  let avoids = itlist (union o frees o concl o snd) asl
+                               (frees w) in
+  let strip  = fun t-> (match t with 
+       |Var(s,_) -> (s,t) | _ -> failwith "TYPE_THEN" ) in
+  let typinfo = map strip avoids in
+  let t' = map (fun u -> snd (type_set typinfo ((frees u),u))) t in
+    (warn ((can (find has_stv) t')) "TYPEL_THEN: unresolved type vars");
+     tac t' (asl,w);;
+
+(* trivial example *)
+
+let _ = prove_by_refinement(`!y. y:num = y`,
+ [
+   GEN_TAC;
+   TYPE_THEN `y:A` (fun t -> ASSUME_TAC(ISPEC t (TAUT `!x:B. x=x`)));
+   UNDISCH_TAC `y:num = y`; (* evidence that `y:A` was retyped as `y:num` *)
+   MESON_TAC[];
+ ]);;
+
+
+(* ------------------------------------------------------------------ *)
+(* SAVE the goalstate, and retrieve later *)
+(* ------------------------------------------------------------------ *)
+
+let (save_goal,get_goal) = 
+  let goal_buffer  = ref [] in
+  let save_goal s = 
+     goal_buffer := (s,!current_goalstack )::!goal_buffer in 
+  let get_goal (s:string) = (current_goalstack:= assoc s !goal_buffer) in
+  (save_goal,get_goal);;
+
+
+(* ------------------------------------------------------------------ *)g      
+(* ordered rewrites with general ord function .
+   This allows rewrites with an arbitrary condition
+    -- adapted from simp.ml *)
+(* ------------------------------------------------------------------ *)
+
+
+
+let net_of_thm_ord ord rep force th =
+  let t = concl th in
+  let lconsts = freesl (hyp th) in
+  let matchable = can o term_match lconsts in
+  try let l,r = dest_eq t in
+      if rep & free_in l r then
+       let th' = EQT_INTRO th in
+       enter lconsts (l,(1,REWR_CONV th'))
+      else if rep & matchable l r & matchable r l then
+        enter lconsts (l,(1,ORDERED_REWR_CONV ord th))
+      else if force then
+        enter lconsts (l,(1,ORDERED_REWR_CONV ord th))
+      else enter lconsts (l,(1,REWR_CONV th))
+  with Failure _ ->
+      let l,r = dest_eq(rand t) in
+      if rep & free_in l r then
+       let tm = lhand t in
+       let th' = DISCH tm (EQT_INTRO(UNDISCH th)) in
+       enter lconsts (l,(3,IMP_REWR_CONV th'))
+      else if rep &  matchable l r & matchable r l then
+        enter lconsts (l,(3,ORDERED_IMP_REWR_CONV ord th))
+      else enter lconsts(l,(3,IMP_REWR_CONV th));;
+
+let GENERAL_REWRITE_ORD_CONV ord rep force (cnvl:conv->conv) (builtin_net:gconv net) thl =
+  let thl_canon = itlist (mk_rewrites false) thl [] in
+  let final_net = itlist (net_of_thm_ord ord rep force ) thl_canon builtin_net in
+  cnvl (REWRITES_CONV final_net);;
+
+let GEN_REWRITE_ORD_CONV ord force (cnvl:conv->conv) thl =
+  GENERAL_REWRITE_ORD_CONV ord false force cnvl empty_net thl;;
+
+let PURE_REWRITE_ORD_CONV ord force thl =
+  GENERAL_REWRITE_ORD_CONV ord true force TOP_DEPTH_CONV empty_net thl;;
+
+let REWRITE_ORD_CONV ord force thl =
+  GENERAL_REWRITE_ORD_CONV ord true force TOP_DEPTH_CONV (basic_net()) thl;;
+
+let PURE_ONCE_REWRITE_ORD_CONV ord force thl =
+  GENERAL_REWRITE_ORD_CONV ord false force ONCE_DEPTH_CONV empty_net thl;;
+
+let ONCE_REWRITE_ORD_CONV ord force thl =
+  GENERAL_REWRITE_ORD_CONV ord false force ONCE_DEPTH_CONV (basic_net()) thl;;
+
+let REWRITE_ORD_TAC ord force thl = CONV_TAC(REWRITE_ORD_CONV ord force thl);;
+                             
+
+
+(* ------------------------------------------------------------------ *)
+(* Move quantifier left. Use class.ml and theorems.ml to bubble
+   quantifiers towards the head of an expression.  It should move
+   quantifiers past other quantifiers, past conjunctions, disjunctions,
+   implications, etc. 
+
+   val quant_left_CONV : string -> term -> thm = <fun>
+   Arguments:
+   var_name:string  -- The name of the variable that is to be shifted.
+
+   It tends to return `T` when the conversion fails.
+
+   Example:
+   quant_left_CONV "a" `!b. ?a. a = b*4`;;
+   val it : thm = |- (!b. ?a. a = b *| 4) = (?a. !b. a b = b *| 4)
+   *)
+(* ------------------------------------------------------------------ *)
+
+let tagb = new_definition `TAGB (x:bool) = x`;;
+
+let is_quant tm = (is_forall tm) or (is_exists tm);;
+
+let rec tag_quant var_name tm = 
+  if (is_forall tm && (fst (dest_var (fst (dest_forall tm))) = var_name))
+  then mk_comb (`TAGB`,tm)
+  else if (is_exists tm && (fst (dest_var (fst (dest_exists tm))) = var_name))   then mk_comb (`TAGB`,tm)
+  else match tm with
+     | Comb (x,y) -> Comb(tag_quant var_name x,tag_quant var_name y)
+     | Abs (x,y) -> Abs(x,tag_quant var_name y)
+     | _ -> tm;;
+
+let quant_left_CONV  = 
+  (* ~! -> ?~ *)
+  let iprove f = prove(f,REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+  let NOT_FORALL_TAG = prove(`!P. ~(TAGB(!x. P x)) = (?x:A. ~(P x))`,
+                            REWRITE_TAC[tagb;NOT_FORALL_THM]) in
+ let SKOLEM_TAG =
+  prove(`!P. (?y. TAGB (!(x:A). P x ((y:A->B) x))) = 
+     ( (!(x:A). ?y. P x ((y:B))))`,REWRITE_TAC[tagb;SKOLEM_THM]) in
+ let SKOLEM_TAG2 =
+   prove(`!P. (!x:A. TAGB(?y:B. P x y)) = (?y. !x. P x (y x))`,
+        REWRITE_TAC[tagb;SKOLEM_THM]) in
+ (* !1 !2 -> !2 !1 *)
+ let SWAP_FORALL_TAG =
+  prove(`!P:A->B->bool. (!x. TAGB(! y. P x y)) = (!y x. P x y)`,
+    REWRITE_TAC[SWAP_FORALL_THM;tagb]) in
+ let SWAP_EXISTS_THM = iprove
+  `!P:A->B->bool. (?x. TAGB (?y. P x y)) = (?y x. P x y)` in
+ (* ! /\ ! -> ! /\ *)
+ let AND_FORALL_TAG = prove(`!P Q. (TAGB (!x. P x) /\ TAGB (!x. Q x) = 
+   (!x. P x /\ Q x))`,REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let LEFT_AND_FORALL_TAG = prove(`!P Q. (TAGB (!x. P x) /\  Q) = 
+   (!x. P x /\ Q )`,REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let RIGHT_AND_FORALL_TAG = prove(`!P Q. P /\ TAGB (!x. Q x) = 
+   (!x. P  /\ Q x)`,REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let TRIV_OR_FORALL_TAG = prove
+ (`!P Q. TAGB (!x:A. P) \/ TAGB (!x:A. Q) = (!x:A. P \/ Q)`,
+  REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let RIGHT_IMP_FORALL_TAG = prove
+ (`!P Q. (P ==> TAGB (!x:A. Q x)) = (!x. P ==> Q x)`,
+  REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let OR_EXISTS_THM = iprove
+  `!P Q. TAGB (?x. P x) \/ TAGB (?x. Q x) = (?x:A. P x \/ Q x)` in
+ let LEFT_OR_EXISTS_THM = iprove
+ `!P Q. TAGB (?x. P x) \/ Q = (?x:A. P x \/ Q)` in
+ let RIGHT_OR_EXISTS_THM = iprove
+ `!P Q. P \/ TAGB (?x. Q x) = (?x:A. P \/ Q x)` in
+ let LEFT_AND_EXISTS_THM = iprove
+ `!P Q. TAGB (?x:A. P x) /\ Q = (?x:A. P x /\ Q)` in
+ let RIGHT_AND_EXISTS_THM = iprove
+ `!P Q. P /\ TAGB (?x:A. Q x) = (?x:A. P /\ Q x)` in
+ let TRIV_AND_EXISTS_THM = iprove
+ `!P Q. TAGB (?x:A. P) /\ TAGB (?x:A. Q) = (?x:A. P /\ Q)` in
+ let LEFT_IMP_EXISTS_THM = iprove
+ `!P Q. (TAGB (?x:A. P x) ==> Q) = (!x. P x ==> Q)` in
+ let TRIV_FORALL_IMP_THM = iprove
+ `!P Q. (TAGB (?x:A. P) ==> TAGB (!x:A. Q)) = (!x:A. P ==> Q) ` in
+ let TRIV_EXISTS_IMP_THM = iprove
+ `!P Q. (TAGB(!x:A. P) ==> TAGB (?x:A. Q)) = (?x:A. P ==> Q) ` in
+ let NOT_EXISTS_TAG = prove(
+ `!P. ~(TAGB(?x:A. P x)) = (!x. ~(P x))`,
+ REWRITE_TAC[tagb;NOT_EXISTS_THM]) in
+ let LEFT_OR_FORALL_TAG = prove
+ (`!P Q. TAGB(!x:A. P x) \/ Q = (!x. P x \/ Q)`,
+ REWRITE_TAC[tagb;LEFT_OR_FORALL_THM]) in
+ let RIGHT_OR_FORALL_TAG = prove
+ (`!P Q. P \/ TAGB(!x:A. Q x) = (!x. P \/ Q x)`,
+  REWRITE_TAC[tagb;RIGHT_OR_FORALL_THM]) in
+ let LEFT_IMP_FORALL_TAG = prove
+ (`!P Q. (TAGB(!x:A. P x) ==> Q) = (?x. P x ==> Q)`,
+ REWRITE_TAC[tagb;LEFT_IMP_FORALL_THM]) in
+ let RIGHT_IMP_EXISTS_TAG = prove
+ (`!P Q. (P ==> TAGB(?x:A. Q x)) = (?x:A. P ==> Q x)`,
+ REWRITE_TAC[tagb;RIGHT_IMP_EXISTS_THM]) in
+  fun var_name tm -> 
+     REWRITE_RULE [tagb]  
+       (TOP_SWEEP_CONV 
+       (GEN_REWRITE_CONV I 
+         [NOT_FORALL_TAG;SKOLEM_TAG;SKOLEM_TAG2;
+         SWAP_FORALL_TAG;SWAP_EXISTS_THM;
+         SWAP_EXISTS_THM;
+          AND_FORALL_TAG;LEFT_AND_FORALL_TAG;RIGHT_AND_FORALL_TAG;
+         TRIV_OR_FORALL_TAG;RIGHT_IMP_FORALL_TAG;
+         OR_EXISTS_THM;LEFT_OR_EXISTS_THM;RIGHT_OR_EXISTS_THM;
+         LEFT_AND_EXISTS_THM;
+         RIGHT_AND_EXISTS_THM;
+         TRIV_AND_EXISTS_THM;LEFT_IMP_EXISTS_THM;TRIV_FORALL_IMP_THM;
+         TRIV_EXISTS_IMP_THM;NOT_EXISTS_TAG;
+         LEFT_OR_FORALL_TAG;RIGHT_OR_FORALL_TAG;LEFT_IMP_FORALL_TAG;
+         RIGHT_IMP_EXISTS_TAG;
+        ]) 
+       (tag_quant var_name tm));;
+
+(* same, but never pass a quantifier past another. No Skolem, etc. *)
+let quant_left_noswap_CONV  = 
+  (* ~! -> ?~ *)
+  let iprove f = prove(f,REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+  let NOT_FORALL_TAG = prove(`!P. ~(TAGB(!x. P x)) = (?x:A. ~(P x))`,
+                            REWRITE_TAC[tagb;NOT_FORALL_THM]) in
+ let SKOLEM_TAG =
+  prove(`!P. (?y. TAGB (!(x:A). P x ((y:A->B) x))) = 
+     ( (!(x:A). ?y. P x ((y:B))))`,REWRITE_TAC[tagb;SKOLEM_THM]) in
+ let SKOLEM_TAG2 =
+   prove(`!P. (!x:A. TAGB(?y:B. P x y)) = (?y. !x. P x (y x))`,
+        REWRITE_TAC[tagb;SKOLEM_THM]) in
+ (* !1 !2 -> !2 !1 *)
+ let SWAP_FORALL_TAG =
+  prove(`!P:A->B->bool. (!x. TAGB(! y. P x y)) = (!y x. P x y)`,
+    REWRITE_TAC[SWAP_FORALL_THM;tagb]) in
+ let SWAP_EXISTS_THM = iprove
+  `!P:A->B->bool. (?x. TAGB (?y. P x y)) = (?y x. P x y)` in
+ (* ! /\ ! -> ! /\ *)
+ let AND_FORALL_TAG = prove(`!P Q. (TAGB (!x. P x) /\ TAGB (!x. Q x) = 
+   (!x. P x /\ Q x))`,REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let LEFT_AND_FORALL_TAG = prove(`!P Q. (TAGB (!x. P x) /\  Q) = 
+   (!x. P x /\ Q )`,REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let RIGHT_AND_FORALL_TAG = prove(`!P Q. P /\ TAGB (!x. Q x) = 
+   (!x. P  /\ Q x)`,REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let TRIV_OR_FORALL_TAG = prove
+ (`!P Q. TAGB (!x:A. P) \/ TAGB (!x:A. Q) = (!x:A. P \/ Q)`,
+  REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let RIGHT_IMP_FORALL_TAG = prove
+ (`!P Q. (P ==> TAGB (!x:A. Q x)) = (!x. P ==> Q x)`,
+  REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let OR_EXISTS_THM = iprove
+  `!P Q. TAGB (?x. P x) \/ TAGB (?x. Q x) = (?x:A. P x \/ Q x)` in
+ let LEFT_OR_EXISTS_THM = iprove
+ `!P Q. TAGB (?x. P x) \/ Q = (?x:A. P x \/ Q)` in
+ let RIGHT_OR_EXISTS_THM = iprove
+ `!P Q. P \/ TAGB (?x. Q x) = (?x:A. P \/ Q x)` in
+ let LEFT_AND_EXISTS_THM = iprove
+ `!P Q. TAGB (?x:A. P x) /\ Q = (?x:A. P x /\ Q)` in
+ let RIGHT_AND_EXISTS_THM = iprove
+ `!P Q. P /\ TAGB (?x:A. Q x) = (?x:A. P /\ Q x)` in
+ let TRIV_AND_EXISTS_THM = iprove
+ `!P Q. TAGB (?x:A. P) /\ TAGB (?x:A. Q) = (?x:A. P /\ Q)` in
+ let LEFT_IMP_EXISTS_THM = iprove
+ `!P Q. (TAGB (?x:A. P x) ==> Q) = (!x. P x ==> Q)` in
+ let TRIV_FORALL_IMP_THM = iprove
+ `!P Q. (TAGB (?x:A. P) ==> TAGB (!x:A. Q)) = (!x:A. P ==> Q) ` in
+ let TRIV_EXISTS_IMP_THM = iprove
+ `!P Q. (TAGB(!x:A. P) ==> TAGB (?x:A. Q)) = (?x:A. P ==> Q) ` in
+ let NOT_EXISTS_TAG = prove(
+ `!P. ~(TAGB(?x:A. P x)) = (!x. ~(P x))`,
+ REWRITE_TAC[tagb;NOT_EXISTS_THM]) in
+ let LEFT_OR_FORALL_TAG = prove
+ (`!P Q. TAGB(!x:A. P x) \/ Q = (!x. P x \/ Q)`,
+ REWRITE_TAC[tagb;LEFT_OR_FORALL_THM]) in
+ let RIGHT_OR_FORALL_TAG = prove
+ (`!P Q. P \/ TAGB(!x:A. Q x) = (!x. P \/ Q x)`,
+  REWRITE_TAC[tagb;RIGHT_OR_FORALL_THM]) in
+ let LEFT_IMP_FORALL_TAG = prove
+ (`!P Q. (TAGB(!x:A. P x) ==> Q) = (?x. P x ==> Q)`,
+ REWRITE_TAC[tagb;LEFT_IMP_FORALL_THM]) in
+ let RIGHT_IMP_EXISTS_TAG = prove
+ (`!P Q. (P ==> TAGB(?x:A. Q x)) = (?x:A. P ==> Q x)`,
+ REWRITE_TAC[tagb;RIGHT_IMP_EXISTS_THM]) in
+  fun var_name tm -> 
+     REWRITE_RULE [tagb]  
+       (TOP_SWEEP_CONV 
+       (GEN_REWRITE_CONV I 
+         [NOT_FORALL_TAG; (* SKOLEM_TAG;SKOLEM_TAG2; *)
+         (* SWAP_FORALL_TAG;SWAP_EXISTS_THM;
+         SWAP_EXISTS_THM; *)
+          AND_FORALL_TAG;LEFT_AND_FORALL_TAG;RIGHT_AND_FORALL_TAG;
+         TRIV_OR_FORALL_TAG;RIGHT_IMP_FORALL_TAG;
+         OR_EXISTS_THM;LEFT_OR_EXISTS_THM;RIGHT_OR_EXISTS_THM;
+         LEFT_AND_EXISTS_THM;
+         RIGHT_AND_EXISTS_THM;
+         TRIV_AND_EXISTS_THM;LEFT_IMP_EXISTS_THM;TRIV_FORALL_IMP_THM;
+         TRIV_EXISTS_IMP_THM;NOT_EXISTS_TAG;
+         LEFT_OR_FORALL_TAG;RIGHT_OR_FORALL_TAG;LEFT_IMP_FORALL_TAG;
+         RIGHT_IMP_EXISTS_TAG;
+        ]) 
+       (tag_quant var_name tm));;
+
+let quant_right_CONV  = 
+  (* ~! -> ?~ *)
+  let iprove f = prove(f,REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+  let NOT_FORALL_TAG = prove(`!P. TAGB(?x:A. ~(P x)) = ~((!x. P x))`,
+                            REWRITE_TAC[tagb;GSYM NOT_FORALL_THM]) in
+ let SKOLEM_TAG =
+  prove(`!P. ( TAGB(!(x:A). ?y. P x ((y:B))))=
+   (?y.  (!(x:A). P x ((y:A->B) x)))`,
+   REWRITE_TAC[tagb;GSYM SKOLEM_THM]) 
+   in
+ let SKOLEM_TAG2 =
+   prove(`!P. TAGB(?y. !x. P x (y x)) = (!x:A. (?y:B. P x y))`,
+        REWRITE_TAC[tagb;GSYM SKOLEM_THM]) in
+ (* !1 !2 -> !2 !1.. *)
+ let SWAP_FORALL_TAG =
+  prove(`!P:A->B->bool.  TAGB(!y x. P x y)= (!x. (! y. P x y))`,
+    REWRITE_TAC[GSYM SWAP_FORALL_THM;tagb]) in
+ let SWAP_EXISTS_THM = iprove
+  `!P:A->B->bool.  TAGB (?y x. P x y)=(?x. (?y. P x y))` in
+ (* ! /\ ! -> ! /\ *)
+ let AND_FORALL_TAG = iprove`!P Q. TAGB(!x. P x /\ Q x)= 
+   ((!x. P x) /\ (!x. Q x))` in 
+ let LEFT_AND_FORALL_TAG = prove(`!P Q.  
+   TAGB(!x. P x /\ Q ) = ((!x. P x) /\  Q)`,
+   REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let RIGHT_AND_FORALL_TAG = prove(`!P Q. 
+   TAGB(!x. P  /\ Q x) = P /\  (!x. Q x)`,
+   REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let TRIV_OR_FORALL_TAG = prove
+ (`!P Q.   TAGB(!x:A. P \/ Q)=(!x:A. P) \/  (!x:A. Q)`,
+  REWRITE_TAC[tagb] THEN ITAUT_TAC) in 
+ let RIGHT_IMP_FORALL_TAG = prove
+ (`!P Q. TAGB (!x. P ==> Q x) = (P ==>  (!x:A. Q x)) `,
+  REWRITE_TAC[tagb] THEN ITAUT_TAC) in
+ let OR_EXISTS_THM = iprove
+  `!P Q.  TAGB(?x:A. P x \/ Q x) = (?x. P x) \/ (?x. Q x) ` in
+ let LEFT_OR_EXISTS_THM = iprove
+ `!P Q. TAGB (?x:A. P x \/ Q) =  (?x. P x) \/ Q ` in
+ let RIGHT_OR_EXISTS_THM = iprove
+ `!P Q.TAGB (?x:A. P \/ Q x)=  P \/ (?x. Q x)` in
+ let LEFT_AND_EXISTS_THM = iprove
+ `!P Q.TAGB (?x:A. P x /\ Q) =  (?x:A. P x) /\ Q` in
+ let RIGHT_AND_EXISTS_THM = iprove
+ `!P Q. TAGB (?x:A. P /\ Q x) =  P /\ (?x:A. Q x) ` in
+ let TRIV_AND_EXISTS_THM = iprove
+ `!P Q. TAGB(?x:A. P /\ Q) =  (?x:A. P) /\  (?x:A. Q) ` in (* *)
+ let LEFT_IMP_EXISTS_THM = iprove
+ `!P Q. TAGB(!x. P x ==> Q) = ( (?x:A. P x) ==> Q) ` in (* *)
+ let TRIV_FORALL_IMP_THM = iprove
+ `!P Q. TAGB(!x:A. P ==> Q)  = ( (?x:A. P) ==>  (!x:A. Q)) ` in
+ let TRIV_EXISTS_IMP_THM = iprove
+ `!P Q. TAGB(?x:A. P ==> Q)  = ((!x:A. P) ==>  (?x:A. Q)) ` in
+ let NOT_EXISTS_TAG = prove(
+ `!P. TAGB(!x. ~(P x)) = ~((?x:A. P x)) `,
+ REWRITE_TAC[tagb;NOT_EXISTS_THM]) in
+ let LEFT_OR_FORALL_TAG = prove
+ (`!P Q. TAGB(!x. P x \/ Q) = (!x:A. P x) \/ Q `,
+ REWRITE_TAC[tagb;LEFT_OR_FORALL_THM]) in
+ let RIGHT_OR_FORALL_TAG = prove
+ (`!P Q. TAGB(!x. P \/ Q x) = P \/ (!x:A. Q x) `,
+  REWRITE_TAC[tagb;RIGHT_OR_FORALL_THM]) in
+ let LEFT_IMP_FORALL_TAG = prove
+ (`!P Q. TAGB(?x. P x ==> Q) = ((!x:A. P x) ==> Q) `,
+ REWRITE_TAC[tagb;LEFT_IMP_FORALL_THM]) in
+ let RIGHT_IMP_EXISTS_TAG = prove
+ (`!P Q. TAGB(?x:A. P ==> Q x) = (P ==> (?x:A. Q x)) `,
+ REWRITE_TAC[tagb;RIGHT_IMP_EXISTS_THM]) in
+  fun var_name tm -> 
+     REWRITE_RULE [tagb]  
+       (TOP_SWEEP_CONV 
+       (GEN_REWRITE_CONV I 
+         [NOT_FORALL_TAG;SKOLEM_TAG;SKOLEM_TAG2;
+         SWAP_FORALL_TAG;SWAP_EXISTS_THM;
+         SWAP_EXISTS_THM;
+          AND_FORALL_TAG;LEFT_AND_FORALL_TAG;RIGHT_AND_FORALL_TAG;
+         TRIV_OR_FORALL_TAG;RIGHT_IMP_FORALL_TAG;
+         OR_EXISTS_THM;LEFT_OR_EXISTS_THM;RIGHT_OR_EXISTS_THM;
+         LEFT_AND_EXISTS_THM;
+         RIGHT_AND_EXISTS_THM;
+         TRIV_AND_EXISTS_THM;LEFT_IMP_EXISTS_THM;TRIV_FORALL_IMP_THM;
+         TRIV_EXISTS_IMP_THM;NOT_EXISTS_TAG;
+         LEFT_OR_FORALL_TAG;RIGHT_OR_FORALL_TAG;LEFT_IMP_FORALL_TAG;
+         RIGHT_IMP_EXISTS_TAG;
+        ]) 
+       (tag_quant var_name tm));;
+
+
+(* ------------------------------------------------------------------ *)
+(* Dropping Superfluous Quantifiers .
+    Example: ?u. (u = t) /\ ... 
+    We can eliminate the u.
+ *)
+(* ------------------------------------------------------------------ *)
+
+let mark_term = new_definition `mark_term (u:A) = u`;;
+
+let rec markq qname tm =
+  match tm with 
+   Var (a,b) -> if (a=qname) then mk_icomb (`mark_term:A->A`,tm) else tm
+  |Const(_,_) -> tm
+  |Comb(s,b) -> Comb(markq qname s,markq qname b)
+  |Abs (x,t) -> Abs (x,markq qname t);;
+
+let rec getquants tm =
+  if (is_forall tm) then
+     (fst (dest_var (fst (dest_forall tm))))::
+        (getquants (snd (dest_forall tm))) 
+  else if (is_exists tm) then
+     (fst (dest_var (fst (dest_exists tm))))::
+        (getquants (snd (dest_exists tm))) 
+  else match tm with
+    Comb(s,b) -> (getquants s) @ (getquants b)
+  | Abs (x,t) -> (getquants t)
+  | _ -> [];;
+
+(* can loop if there are TWO *)
+let rewrite_conjs = [
+  prove_by_refinement (`!A B C. (A /\ B) /\ C = A /\ B /\ C`,[REWRITE_TAC[CONJ_ACI]]);
+  prove_by_refinement (`!u. (mark_term (u:A) = mark_term u) = T`,[MESON_TAC[]]);
+  prove_by_refinement (`!u t. (t = mark_term (u:A)) = (mark_term u = t)`,[MESON_TAC[]]);
+  prove_by_refinement (`!u a b. (mark_term (u:A) = a) /\ (mark_term u = b) = (mark_term u = a) /\ (a = b)`,[MESON_TAC[]]);
+  prove_by_refinement (`!u a b B. (mark_term (u:A) = a) /\ (mark_term u = b) /\ B = (mark_term u = a) /\ (a = b) /\ B`,[MESON_TAC[]]);
+  prove_by_refinement (`!u t A C. A /\ (mark_term (u:A) = t) /\ C = 
+        (mark_term u = t) /\ A /\ C`,[MESON_TAC[]]);
+  prove_by_refinement (`!A u t. A /\ (mark_term (u:A) = t)  = 
+        (mark_term u = t) /\ A `,[MESON_TAC[]]);
+  prove_by_refinement (`!u t C D. (((mark_term (u:A) = t) /\ C) ==> D) = 
+        ((mark_term (u:A) = t) ==> C ==> D)`,[MESON_TAC[]]);
+  prove_by_refinement (`!A u t B. (A ==> (mark_term (u:A) = t) ==> B) = 
+         ((mark_term (u:A) = t) ==> A ==> B)`,[MESON_TAC[]]);
+];;
+
+let higher_conjs = [
+  prove_by_refinement (`!C u t. ((mark_term u = t) ==> C (mark_term u)) = 
+       ((mark_term u = t) ==> C (t:A))`,[MESON_TAC[mark_term]]); 
+  prove_by_refinement (`!C u t. ((mark_term u = t) /\ C (mark_term u)) = 
+         ((mark_term u = t) /\ C (t:A))`,[MESON_TAC[mark_term]]);
+];;
+
+
+let dropq_conv  =
+  let drop_exist = 
+    REWRITE_CONV [prove_by_refinement (`!t. ?(u:A). (u = t)`,[MESON_TAC[]])] in
+  fun qname tm -> 
+  let quanlist =  getquants tm in
+  let quantleft_CONV = EVERY_CONV 
+      (map (REPEATC o quant_left_noswap_CONV) quanlist) in
+  let qname_conv tm = prove(mk_eq(tm,markq qname tm),
+             REWRITE_TAC[mark_term]) in
+  let conj_conv = REWRITE_CONV rewrite_conjs in
+  let quantright_CONV = (REPEATC (quant_right_CONV qname)) in
+  let drop_mark_CONV = REWRITE_CONV [mark_term] in
+ (quantleft_CONV THENC qname_conv  THENC conj_conv   THENC
+      (ONCE_REWRITE_CONV higher_conjs) 
+       THENC drop_mark_CONV THENC quantright_CONV THENC 
+       drop_exist  ) tm ;;
+  
+
+(* Examples : *)
+dropq_conv "u" `!P Q R . (?(u:B). (?(x:A). (u = P x) /\ (Q x)) /\ (R u))`;;
+dropq_conv "t" `!P Q R. (!(t:B). (?(x:A). P x /\ (t = Q x)) ==> R t)`;;
+
+dropq_conv "u" `?u v.
+     ((t * (a + &1) + (&1 - t) *a = u) /\
+      (t * (b + &0) + (&1 - t) * b = v)) /\
+     a < u /\
+     u < r /\
+     (v = b)`;;
+
+
+
+(* ------------------------------------------------------------------ *)
+(*  SOME GENERAL TACTICS FOR THE ASSUMPTION LIST *)
+(* ------------------------------------------------------------------ *)
+
+let (%) i = HYP (string_of_int i);;
+
+let WITH i rule = (H_VAL (rule) (HYP (string_of_int i))) ;;
+
+let (UND:int -> tactic) =
+ fun i (asl,w) ->
+   let name = "Z-"^(string_of_int i) in
+   try let thm= assoc name asl in
+        let tm = concl (thm) in
+       let (_,asl') = partition (fun t-> ((=) name (fst t))) asl in
+       null_meta,[asl',mk_imp(tm,w)],
+       fun i [th] -> MP th (INSTANTIATE_ALL i thm)
+   with Failure _ -> failwith "UND";;
+
+let KILL i = 
+  (UND i) THEN (DISCH_THEN (fun t -> ALL_TAC));;
+
+let USE i rule = (WITH i rule) THEN (KILL i);;
+
+let CHO i = (UND i) THEN (DISCH_THEN CHOOSE_TAC);;
+
+let X_CHO i t = (UND i) THEN (DISCH_THEN (X_CHOOSE_TAC t));; 
+
+let AND i = (UND i) THEN 
+  (DISCH_THEN (fun t-> (ASSUME_TAC (CONJUNCT1 t) 
+                         THEN (ASSUME_TAC (CONJUNCT2 t)))));;
+
+let JOIN i j = 
+   (H_VAL2 CONJ ((%)i) ((%)j)) THEN (KILL i) THEN (KILL j);;
+
+let COPY i = WITH i I;;
+
+let REP n tac = EVERY (replicate tac n);;
+
+let REWR i = (UND i) THEN (ASM_REWRITE_TAC[]) THEN DISCH_TAC;;
+
+let LEFT i t = (USE i (CONV_RULE (quant_left_CONV t)));;
+
+let RIGHT i t =  (USE i (CONV_RULE (quant_right_CONV t)));;
+
+let LEFT_TAC  t = ((CONV_TAC (quant_left_CONV t)));;
+
+let RIGHT_TAC t =  ( (CONV_TAC (quant_right_CONV t)));;
+
+let INR = REWRITE_RULE[IN];;
+
+(*
+
+
+
+let rec REP n tac = if (n<=0) then ALL_TAC 
+  else (tac THEN (REP (n-1) tac));;  (* doesn't seem to work? *)
+
+
+let COPY i = (UNDISCH_WITH i) THEN (DISCH_THEN (fun t->ALL_TAC));;
+
+
+MANIPULATING ASSUMPTIONS. (MAKE 0= GOAL)
+
+COPY: int -> tactic   Make a copy in adjacent slot.
+
+
+EXPAND: int -> tactic.
+    conjunction -> two separate.
+    exists/goal-forall -> choose.
+    goal-if-then -> discharge
+EXPAND_TERM: int -> term -> tactic.
+    constant -> expand definition or other rewrites associated.
+ADD: term -> tactic.
+    
+SIMPLIFY: int -> tactic.  Apply simplification rules.
+       
+
+*)
+
+let CONTRAPOSITIVE_TAC = MATCH_MP_TAC (TAUT `(~q ==> ~p) ==> (p ==> q)`)
+                          THEN REWRITE_TAC[];;
+
+let REWRT_TAC = (fun t-> REWRITE_TAC[t]);;
+
+let (REDUCE_CONV,REDUCE_TAC) = 
+ let list = [
+   (* reals *)   REAL_NEG_GE0;
+   REAL_HALF_DOUBLE;
+   REAL_SUB_REFL ;
+   REAL_NEG_NEG;
+   REAL_LE; LE_0;
+   REAL_ADD_LINV;REAL_ADD_RINV;
+   REAL_NEG_0;
+   REAL_NEG_LE0;
+   REAL_NEG_GE0;
+   REAL_LE_NEGL;
+   REAL_LE_NEGR;
+   REAL_LE_NEG;
+   REAL_NEG_EQ_0;
+   REAL_SUB_RNEG;
+   REAL_ARITH `!(x:real). (--x = x) =  (x = &.0)`;
+   REAL_ARITH `!(a:real) b. (a - b + b) = a`;
+   REAL_ADD_LID;
+   REAL_ADD_RID ;
+   REAL_INV_0;
+   REAL_OF_NUM_EQ;
+   REAL_OF_NUM_LE;
+   REAL_OF_NUM_LT;
+   REAL_OF_NUM_ADD;
+   REAL_OF_NUM_MUL;
+   REAL_POS;
+   REAL_MUL_RZERO;
+   REAL_MUL_LZERO;
+  &nb