1010
1111Require Import Ltac2.Init.
1212
13- (** Abstract type representing a transparency state. *)
13+ (** Abstract type representing a transparency state. A transparency state
14+ is a set of variables, constants, and primitive projections. *)
1415Ltac2 Type t.
1516
1617(** [empty] is the empty transparency state (all constants are opaque). *)
@@ -25,3 +26,63 @@ Ltac2 @ external full : t :=
2526 by, e.g., the [Strategy] command, or the [with_strategy] Ltac tactic. *)
2627Ltac2 @ external current : unit -> t :=
2728 "rocq-runtime.plugins.ltac2" "current_transparent_state".
29+
30+ (** [union t1 t2] builds a transparency state containing all the variables,
31+ constants, and primitive projections which are either in [t1] or in [t2]. *)
32+ Ltac2 @ external union : t -> t -> t :=
33+ "rocq-runtime.plugins.ltac2" "union_transparent_state".
34+
35+ (** [inter t1 t2] builds a transparency state containing all the variables,
36+ constants, and primitive projections which are both in [t1] and in [t2]. *)
37+ Ltac2 @ external inter : t -> t -> t :=
38+ "rocq-runtime.plugins.ltac2" "inter_transparent_state".
39+
40+ (** [diff t1 t2] builds a transparency state containing all the variables,
41+ constants, and primitive projections which are in [t1] but not in [t2]. *)
42+ Ltac2 @ external diff : t -> t -> t :=
43+ "rocq-runtime.plugins.ltac2" "diff_transparent_state".
44+
45+ (** [add_constant c t] adds the constant [c] to the transparency state [t].
46+ Does nothing if the constant is already present. *)
47+ Ltac2 @ external add_constant : constant -> t -> t :=
48+ "rocq-runtime.plugins.ltac2" "add_constant_transparent_state".
49+
50+ (** [add_proj p t] adds the primitive projection [p] to the transparency
51+ state [t]. Does nothing if the projection is already present. *)
52+ Ltac2 @ external add_proj : projection -> t -> t :=
53+ "rocq-runtime.plugins.ltac2" "add_proj_transparent_state".
54+
55+ (** [add_var p t] adds the local variable [v] to the transparency state [t].
56+ Does nothing if the variable is already present. *)
57+ Ltac2 @ external add_var : ident -> t -> t :=
58+ "rocq-runtime.plugins.ltac2" "add_var_transparent_state".
59+
60+ (** [remove_constant c t] removes the constant [c] from the transparency
61+ state [t]. Does nothing if the constant is not present. *)
62+ Ltac2 @ external remove_constant : constant -> t -> t :=
63+ "rocq-runtime.plugins.ltac2" "remove_constant_transparent_state".
64+
65+ (** [remove_proj p t] removes the primitive projection [p] from the
66+ transparency state [t]. Does nothing if the projection is not present. *)
67+ Ltac2 @ external remove_proj : projection -> t -> t :=
68+ "rocq-runtime.plugins.ltac2" "remove_proj_transparent_state".
69+
70+ (** [remove_var p t] removes the local variable [v] from the transparency
71+ state [t]. Does nothing if the variable is not present. *)
72+ Ltac2 @ external remove_var : ident -> t -> t :=
73+ "rocq-runtime.plugins.ltac2" "remove_var_transparent_state".
74+
75+ (** [mem_constant c t] checks whether the constant [c] is present in the
76+ transparency state [t]. *)
77+ Ltac2 @ external mem_constant : constant -> t -> bool :=
78+ "rocq-runtime.plugins.ltac2" "mem_constant_transparent_state".
79+
80+ (** [mem_proj p t] checks whether the primitive projection [p] is present in the
81+ transparency state [t]. *)
82+ Ltac2 @ external mem_proj : projection -> t -> bool :=
83+ "rocq-runtime.plugins.ltac2" "mem_proj_transparent_state".
84+
85+ (** [mem_var v t] checks whether the local variable [v] is present in the
86+ transparency state [t]. *)
87+ Ltac2 @ external mem_var : ident -> t -> bool :=
88+ "rocq-runtime.plugins.ltac2" "mem_var_transparent_state".
0 commit comments