-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathml_hol_kernelProgScript.sml
64 lines (44 loc) · 1.83 KB
/
ml_hol_kernelProgScript.sml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
(*
Close the kernel module from ml_hol_kernel_funsProg
*)
open preamble;
open ml_translatorLib ml_monad_translatorLib ml_progLib
ml_hol_kernel_funsProgTheory ml_pmatchTheory;
open holKernelTheory;
local open holKernelPmatchTheory in end
val _ = new_theory "ml_hol_kernelProg";
val _ = m_translation_extends "ml_hol_kernel_funsProg"
(* Translation of functions used by e.g. the OpenTheory checker. *)
val def = m_translate mk_eq_def;
val res = translate aconv_def;
val res = translate holKernelPmatchTheory.is_eq_def;
val def = m_translate mk_fun_ty_def;
val _ = next_ml_names := ["SYM"];
val def = m_translate holKernelPmatchTheory.SYM_def;
val _ = next_ml_names := ["PROVE_HYP"];
val def = m_translate PROVE_HYP_def;
val _ = next_ml_names := ["ALPHA_THM"];
val def = m_translate ALPHA_THM_def;
val def = m_translate context_def;
val _ = ml_prog_update close_local_blocks;
val _ = ml_prog_update (close_module NONE);
(* extract the interesting theorem *)
val _ = Globals.max_print_depth := 10;
fun define_abbrev_conv name tm = let
val def = define_abbrev true name tm
in GSYM def |> SPEC_ALL end
Theorem candle_prog_thm =
get_Decls_thm (get_ml_prog_state())
|> CONV_RULE ((RATOR_CONV o RATOR_CONV o RAND_CONV)
(EVAL THENC define_abbrev_conv "candle_code"))
|> CONV_RULE ((RATOR_CONV o RAND_CONV)
(EVAL THENC define_abbrev_conv "candle_init_env"))
|> CONV_RULE ((RAND_CONV)
(EVAL THENC define_abbrev_conv "candle_init_state"));
(* extract some other other theorems *)
Theorem EqualityType_TYPE_TYPE = EqualityType_rule [] “:type”;
Theorem EqualityType_TERM_TYPE = EqualityType_rule [] “:term”;
Theorem EqualityType_THM_TYPE = EqualityType_rule [] “:thm”;
Theorem EqualityType_UPDATE_TYPE = EqualityType_rule [] “:update”;
val _ = (print_asts := true);
val _ = export_theory();