-
Notifications
You must be signed in to change notification settings - Fork 0
/
autocorres_data.ML
52 lines (45 loc) · 1.56 KB
/
autocorres_data.ML
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
(*
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
*
* SPDX-License-Identifier: BSD-2-Clause
*)
(*
* Definition of context data.
*)
signature AUTOCORRES_DATA =
sig
datatype Trace =
RuleTrace of thm AutoCorresTrace.RuleTrace
| SimpTrace of AutoCorresTrace.SimpTrace
(* Actual storage for traces. See below for documentation *)
structure Traces: THEORY_DATA
end
structure AutoCorresData : AUTOCORRES_DATA =
struct
(*
* Container type for various trace data.
* TODO: consolidate these in a better way.
*)
datatype Trace =
RuleTrace of thm AutoCorresTrace.RuleTrace (* HeapLift and WordAbstract main stages *)
| SimpTrace of AutoCorresTrace.SimpTrace (* simp lemma bucket for L2Opt and TypeStrengthen *)
(* Function translation traces.
* These are for informational or debugging usage. *)
structure Traces = Theory_Data (
type T = Trace Symtab.table (* trace type *)
Symtab.table (* func name *)
Symtab.table (* file *);
val empty = Symtab.empty;
(* We need a deep merge due to incremental translations (which can span
* multiple theories). snd is arbitrary. *)
val merge = Utils.symtab_merge_with (Utils.symtab_merge_with (Utils.symtab_merge_with snd));
)
end (* structure AutoCorresData *)
(* Function translation information.
* This is needed for resuming incremental translations. *)
structure AutoCorresFunctionInfo = Theory_Data(
type T = FunctionInfo.function_info Symtab.table
FunctionInfo.Phasetab.table Symtab.table;
val empty = Symtab.empty;
val merge = Symtab.merge (K true);
)