diff options
| author | Pierre-Marie Pédrot | 2014-03-19 19:10:43 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2014-03-19 21:04:25 +0100 |
| commit | 2d015514b890c2c6f5506fa15c5b592209a590ae (patch) | |
| tree | 7007e9454c587ea6496d3c4d24b5e808aaa785de /kernel | |
| parent | 53138852926664706193f09d013d3e8087f7bc8f (diff) | |
Adding a Print Strategy vernacular command. It allows to check the
transparent status of variables and constants.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/conv_oracle.ml | 6 | ||||
| -rw-r--r-- | kernel/conv_oracle.mli | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/kernel/conv_oracle.ml b/kernel/conv_oracle.ml index 32aaacb629..4f2631a66c 100644 --- a/kernel/conv_oracle.ml +++ b/kernel/conv_oracle.ml @@ -54,6 +54,12 @@ let set_strategy ({ var_opacity; cst_opacity } as oracle) k l = else Cmap.add c l cst_opacity } | RelKey _ -> Errors.error "set_strategy: RelKey" +let fold_strategy f { var_opacity; cst_opacity; } accu = + let fvar id lvl accu = f (VarKey id) lvl accu in + let fcst cst lvl accu = f (ConstKey cst) lvl accu in + let accu = Id.Map.fold fvar var_opacity accu in + Cmap.fold fcst cst_opacity accu + let get_transp_state { var_opacity; cst_opacity } = (Id.Map.fold (fun id l ts -> if l=Opaque then Id.Pred.remove id ts else ts) diff --git a/kernel/conv_oracle.mli b/kernel/conv_oracle.mli index 24797238d4..cd8cd2cf7a 100644 --- a/kernel/conv_oracle.mli +++ b/kernel/conv_oracle.mli @@ -35,5 +35,8 @@ val get_strategy : oracle -> 'a tableKey -> level * Level of RelKey constant cannot be set. *) val set_strategy : oracle -> 'a tableKey -> level -> oracle +(** Fold over the non-transparent levels of the oracle. Order unspecified. *) +val fold_strategy : (unit tableKey -> level -> 'a -> 'a) -> oracle -> 'a -> 'a + val get_transp_state : oracle -> transparent_state |
