aboutsummaryrefslogtreecommitdiff
path: root/kernel/opaqueproof.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2019-05-16 00:02:54 +0200
committerPierre-Marie Pédrot2019-05-20 14:10:58 +0200
commit27468ae02bbbf018743d53a9db49efa34b6d6a3e (patch)
treee8fa5ad95ba323d76af06d24e9d804a0dae94844 /kernel/opaqueproof.ml
parent801aed67a90ec49c15a4469e1905aa2835fabe19 (diff)
Ensure statically that declarations built by Term_typing are direct.
This removes a lot of cruft breaking the opaque proof abstraction in Safe_typing and similar.
Diffstat (limited to 'kernel/opaqueproof.ml')
-rw-r--r--kernel/opaqueproof.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/opaqueproof.ml b/kernel/opaqueproof.ml
index 57059300b8..423a416ca4 100644
--- a/kernel/opaqueproof.ml
+++ b/kernel/opaqueproof.ml
@@ -100,6 +100,10 @@ let join_opaque ?except { opaque_val = prfs; opaque_dir = odp; _ } = function
let fp = snd (Int.Map.find i prfs) in
join except fp
+let force_direct = function
+| Direct (_, cu) -> Future.force cu
+| Indirect _ -> CErrors.anomaly (Pp.str "Not a direct opaque.")
+
let force_proof { opaque_val = prfs; opaque_dir = odp; _ } = function
| Direct (_,cu) ->
fst(Future.force cu)