Skip to content

Commit 9fe0a3b

Browse files
MevenBertrandyforster
authored andcommitted
remove the printing of weird notations for substitutions as functions
1 parent 9536705 commit 9fe0a3b

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

lib/automationGen.ml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,8 @@ module NotationGen = struct
141141
| Up
142142
| UpInst of string
143143
| SubstApply of string list
144-
| Subst of string list
145144
| RenApply of string list
146-
| Ren of string list
147-
145+
148146
let subst_scope = "subst_scope"
149147
let fscope = "fscope"
150148

@@ -167,13 +165,9 @@ module NotationGen = struct
167165
sprintf "↑__%s" sort
168166
| SubstApply substSorts ->
169167
sprintf "s [ %s ]" (concat_substs (to_substs "sigma" substSorts))
170-
| Subst substSorts ->
171-
sprintf "[ %s ]" (concat_substs (to_substs "sigma" substSorts))
172168
| RenApply substSorts ->
173169
sprintf "s ⟨ %s ⟩" (concat_substs (to_substs "xi" substSorts))
174-
| Ren substSorts ->
175-
sprintf "⟨ %s ⟩" (concat_substs (to_substs "xi" substSorts))
176-
170+
177171
let notation_modifiers sort n =
178172
let open Printf in
179173
match n with
@@ -189,16 +183,12 @@ module NotationGen = struct
189183
[ only_print_ ]
190184
| SubstApply _ | RenApply _ ->
191185
[ level_ 7; assoc_ LeftA; only_print_ ]
192-
| Subst _ | Ren _ ->
193-
[ level_ 1; assoc_ LeftA; only_print_ ]
194-
186+
195187
let notation_scope = function
196188
| VarConstr | VarInst | Var | Up | UpInst _
197189
| SubstApply _ | RenApply _ ->
198190
subst_scope
199-
| Subst _ | Ren _ ->
200-
fscope
201-
191+
202192
(* DONE hardcoded strings ersetzen durch die korrekten functionen in CoqNames *)
203193
let notation_body sort = function
204194
| VarConstr -> app_ref (var_ sort) [ ref_ "x" ]
@@ -208,9 +198,7 @@ module NotationGen = struct
208198
| Up -> ref_ (up_class_ sort)
209199
| UpInst bsort -> ref_ (up_inst_ bsort sort)
210200
| SubstApply substSorts -> app_ref (subst_ sort) ((List.map ref_ (to_substs "sigma" substSorts)) @ [ ref_ "s" ])
211-
| Subst substSorts -> app_ref (subst_ sort) (List.map ref_ (to_substs "sigma" substSorts))
212201
| RenApply substSorts -> app_ref (ren_ sort) ((List.map ref_ (to_substs "xi" substSorts)) @ [ ref_ "s" ])
213-
| Ren substSorts -> app_ref (ren_ sort) (List.map ref_ (to_substs "xi" substSorts))
214202
end
215203

216204

lib/automationGen.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ module NotationGen : sig
5252
| Up
5353
| UpInst of string
5454
| SubstApply of string list
55-
| Subst of string list
5655
| RenApply of string list
57-
| Ren of string list
5856

5957
val fscope : scope_name
6058
val subst_scope : scope_name

lib/codeGenerator.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ module Renamings : COMPONENT_GENERATOR = FixGen(struct
250250
let* () = tell_instance (ClassGen.Ren (List.length substSorts), sort, ss_names ms @ ss_names ns) in
251251
let* () = tell_cbn_function (ren_ sort) in
252252
let* () = tell_notation (NotationGen.RenApply substSorts, sort) in
253-
let* () = tell_notation (NotationGen.Ren substSorts, sort) in
254253
let* () = tell_proper_instance (sort, ren_ sort, extRen_ sort) in
255254
(* DONE what is the result of to_var here?\
256255
* when I call it with sort=tm, xi=[xity;xivl] I get this weird error term that to_var constructs. This is then probably ignored by some similar logic in the traversal. Seems brittle.
@@ -330,7 +329,6 @@ module Substitutions : COMPONENT_GENERATOR = FixGen(struct
330329
let* () = tell_class (ClassGen.Up "", sort) in
331330
let* () = tell_notation (NotationGen.Up, sort) in
332331
let* () = tell_notation (NotationGen.SubstApply substSorts, sort) in
333-
let* () = tell_notation (NotationGen.Subst substSorts, sort) in
334332
let* () = tell_proper_instance (sort, subst_ sort, ext_ sort) in
335333
(** type *)
336334
let (s, bs) = genMatchVar sort ms in

0 commit comments

Comments
 (0)