diff options
| author | Enrico Tassi | 2019-06-03 17:54:18 +0200 |
|---|---|---|
| committer | Enrico Tassi | 2019-06-03 17:54:18 +0200 |
| commit | a18b1ae63e07cf7e174e3e8862ac32f00ce74865 (patch) | |
| tree | 16eb5c39436b6b03dce93d897786fddc9faa9aa3 /doc/plugin_tutorial/tuto1/src/simple_check.ml | |
| parent | f051e10bbd357cd45d5b24b30abac325b0057b95 (diff) | |
| parent | 8cbaef18373cb255a8806d6563a6729276ad564e (diff) | |
Merge PR #10287: Update tutorial plugin to use sigma instad of evd, in keeping with doc recommendations
Reviewed-by: gares
Diffstat (limited to 'doc/plugin_tutorial/tuto1/src/simple_check.ml')
| -rw-r--r-- | doc/plugin_tutorial/tuto1/src/simple_check.ml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/plugin_tutorial/tuto1/src/simple_check.ml b/doc/plugin_tutorial/tuto1/src/simple_check.ml index 2949adde73..c2f09c64e0 100644 --- a/doc/plugin_tutorial/tuto1/src/simple_check.ml +++ b/doc/plugin_tutorial/tuto1/src/simple_check.ml @@ -1,32 +1,32 @@ let simple_check1 value_with_constraints = begin let evalue, st = value_with_constraints in - let evd = Evd.from_ctx st in + let sigma = Evd.from_ctx st in (* This is reverse engineered from vernacentries.ml *) (* The point of renaming is to make sure the bound names printed by Check can be re-used in `apply with` tactics that use bound names to refer to arguments. *) let j = Environ.on_judgment EConstr.of_constr (Arguments_renaming.rename_typing (Global.env()) - (EConstr.to_constr evd evalue)) in + (EConstr.to_constr sigma evalue)) in let {Environ.uj_type=x}=j in x end let simple_check2 value_with_constraints = let evalue, st = value_with_constraints in - let evd = Evd.from_ctx st in + let sigma = Evd.from_ctx st in (* This version should be preferred if bound variable names are not so important, you want to really verify that the input is well-typed, and if you want to obtain the type. *) (* Note that the output value is a pair containing a new evar_map: typing will fill out blanks in the term by add evar bindings. *) - Typing.type_of (Global.env()) evd evalue + Typing.type_of (Global.env()) sigma evalue let simple_check3 value_with_constraints = let evalue, st = value_with_constraints in - let evd = Evd.from_ctx st in + let sigma = Evd.from_ctx st in (* This version should be preferred if bound variable names are not so important and you already expect the input to have been type-checked before. Set ~lax to false if you want an anomaly to be raised in case of a type error. Otherwise a ReTypeError exception is raised. *) - Retyping.get_type_of ~lax:true (Global.env()) evd evalue + Retyping.get_type_of ~lax:true (Global.env()) sigma evalue |
