-
Notifications
You must be signed in to change notification settings - Fork 148
/
Copy pathcompile
66 lines (56 loc) · 2.76 KB
/
compile
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
load "elliptic_exampleTheory";
loadPath := (HOLDIR^"/examples/dev/sw") :: !loadPath;
use "compiler";
open Assem BasicProvers elliptic_exampleTheory IRSyntax annotatedIR;
type_abbrev("word32", ``:word32``); (* undo DATA abbrev *)
(*---------------------------------------------------------------------------*)
(* To be compiled *)
(* *)
(* ex1_field_neg_alt *)
(* ex1_field_add_alt *)
(* ex1_field_mult_aux_alt *)
(* ex1_field_mult_alt *)
(* ex1_field_exp_aux_alt *)
(* ex1_field_exp_alt *)
(* ex1_field_inv_alt *)
(* ex1_field_div_alt *)
(* *)
(* ex1_curve_neg_alt *)
(* ex1_curve_double_alt *)
(* ex1_curve_add_alt *)
(* ex1_curve_mult_aux_alt *)
(* ex1_curve_mult_alt *)
(* The following two need more massaging *)
(* ex1_elgamal_encrypt_alt *)
(* ex1_elgamal_decrypt_alt *)
(*---------------------------------------------------------------------------*)
let open EmitML ellipticTheory
in
emitML ""
("ex1", OPEN ["words", "num"] ::
MLSIG "type word32 = wordsML.word32"
::
map (DEFN o wordsLib.WORDS_EMIT_RULE)
[ex1_field_neg_alt, ex1_field_add_alt, ex1_field_sub_alt,
ex1_field_mult_aux_alt, ex1_field_mult_alt, ex1_field_exp_aux_alt,
ex1_field_exp_alt, ex1_field_inv_alt, ex1_field_div_alt,
ex1_curve_neg_alt, ex1_curve_double_alt, ex1_curve_add_alt,
ex1_curve_mult_aux_alt, ex1_curve_mult_alt
(* , affine_case, ex1_elgamal_encrypt_alt, ex1_elgamal_decrypt_alt
*)
])
end;
(* Works *)
pp_compile ex1_field_neg_alt true;
(* Works *)
pp_compile ex1_field_add_alt true;
(* Fails *)
pp_compile ex1_field_sub_alt true;
(* Fails *)
pp_compile ex1_field_mult_aux_alt true;
(* Fails *)
pp_compile ex1_curve_neg_alt true;
(* Fails? *)
pp_compile ex1_curve_double_alt true;
(* Fails? *)
pp_compile ex1_curve_add_alt true;