summaryrefslogtreecommitdiff
path: root/kernel/conv_oracle.ml
diff options
context:
space:
mode:
authorGravatar Samuel Mimram <samuel.mimram@ens-lyon.org>2004-07-28 21:54:47 +0000
committerGravatar Samuel Mimram <samuel.mimram@ens-lyon.org>2004-07-28 21:54:47 +0000
commit6b649aba925b6f7462da07599fe67ebb12a3460e (patch)
tree43656bcaa51164548f3fa14e5b10de5ef1088574 /kernel/conv_oracle.ml
Imported Upstream version 8.0pl1upstream/8.0pl1
Diffstat (limited to 'kernel/conv_oracle.ml')
-rw-r--r--kernel/conv_oracle.ml43
1 files changed, 43 insertions, 0 deletions
diff --git a/kernel/conv_oracle.ml b/kernel/conv_oracle.ml
new file mode 100644
index 00000000..dba373ce
--- /dev/null
+++ b/kernel/conv_oracle.ml
@@ -0,0 +1,43 @@
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+
+(* $Id: conv_oracle.ml,v 1.2.8.2 2004/07/16 19:30:24 herbelin Exp $ *)
+
+open Names
+open Closure
+
+(* Opaque constants *)
+let cst_transp = ref KNpred.full
+
+let set_opaque_const kn = cst_transp := KNpred.remove kn !cst_transp
+let set_transparent_const kn = cst_transp := KNpred.add kn !cst_transp
+
+let is_opaque_cst kn = not (KNpred.mem kn !cst_transp)
+
+(* Opaque variables *)
+let var_transp = ref Idpred.full
+
+let set_opaque_var kn = var_transp := Idpred.remove kn !var_transp
+let set_transparent_var kn = var_transp := Idpred.add kn !var_transp
+
+let is_opaque_var kn = not (Idpred.mem kn !var_transp)
+
+(* Opaque reference keys *)
+let is_opaque = function
+ | ConstKey cst -> is_opaque_cst cst
+ | VarKey id -> is_opaque_var id
+ | FarRelKey _ -> false
+
+(* Unfold the first only if it is not opaque and the second is opaque *)
+let oracle_order k1 k2 = is_opaque k2 & not (is_opaque k1)
+
+(* summary operations *)
+
+let init() = (cst_transp := KNpred.full; var_transp := Idpred.full)
+let freeze () = (!var_transp, !cst_transp)
+let unfreeze (vo,co) = (cst_transp := co; var_transp := vo)