Debian Codegraph @

pretyping/evaluable.ml

raw symbols SCIP
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 (** Evaluable references (whose transparency can be controlled) *)
12
13 open Names
14
15 type t =
16 | EvalVarRef of Id.t
17 | EvalConstRef of Constant.t
18 | EvalProjectionRef of Projection.Repr.t
19
20 let map fvar fcst fprj = function
21 | EvalVarRef v -> EvalVarRef (fvar v)
22 | EvalConstRef c -> EvalConstRef (fcst c)
23 | EvalProjectionRef p -> EvalProjectionRef (fprj p)
24
25 let equal env er1 er2 =
26 er1 == er2 ||
27 match er1, er2 with
28 | EvalVarRef v1, EvalVarRef v2 ->
29 Id.equal v1 v2
30 | EvalConstRef c1, EvalConstRef c2 ->
31 Environ.QConstant.equal env c1 c2
32 | EvalProjectionRef p1, EvalProjectionRef p2 ->
33 Environ.QProjection.Repr.equal env p1 p2
34 | _ -> false
35
36 let to_kevaluable : t -> Conv_oracle.evaluable = fun er ->
37 match er with
38 | EvalVarRef v -> Conv_oracle.EvalVarRef v
39 | EvalConstRef c -> Conv_oracle.EvalConstRef c
40 | EvalProjectionRef p -> Conv_oracle.EvalProjectionRef p