aboutsummaryrefslogtreecommitdiff
path: root/spartan/core/ml/types.ML
diff options
context:
space:
mode:
authorJosh Chen2020-06-15 11:53:44 +0200
committerJosh Chen2020-06-15 11:53:44 +0200
commite42b7b3c7d29160939a150b9ec94fc476f7d53e3 (patch)
treed2e404094ff77d1969eb1207f542095794246038 /spartan/core/ml/types.ML
parent9050b7414021db31b23a034567ebc6da3f6c5f67 (diff)
parent69bf0744a5ce3ba144f59564ebf74d7d2f56b748 (diff)
Merge branch 'dev'
Diffstat (limited to 'spartan/core/ml/types.ML')
-rw-r--r--spartan/core/ml/types.ML18
1 files changed, 18 insertions, 0 deletions
diff --git a/spartan/core/ml/types.ML b/spartan/core/ml/types.ML
new file mode 100644
index 0000000..b0792fe
--- /dev/null
+++ b/spartan/core/ml/types.ML
@@ -0,0 +1,18 @@
+structure Types
+= struct
+
+structure Data = Generic_Data (
+ type T = thm Item_Net.T
+ val empty = Item_Net.init Thm.eq_thm
+ (single o Lib.term_of_typing o Thm.prop_of)
+ val extend = I
+ val merge = Item_Net.merge
+)
+
+fun put_type typing = Context.proof_map (Data.map (Item_Net.update typing))
+fun put_types typings = foldr1 (op o) (map put_type typings)
+
+fun get_types ctxt tm = Item_Net.retrieve (Data.get (Context.Proof ctxt)) tm
+
+
+end