@@ -57,8 +57,8 @@ def $subst_typ(s, ITER t it) = ITER $subst_typ(s, t) $subst_iter(s, it)
5757
5858def $subst_deftyp(subst, deftyp) : deftyp
5959def $subst_deftyp(s, ALIAS t) = ALIAS $subst_typ(s, t)
60- def $subst_deftyp(s, STRUCT (a `: t `- `{q*} pr*)*) = STRUCT (a `: $subst_typ(s, t) `- `{$subst_quant(s, b )*} $subst_prem(s, pr)*)* ;; TODO: avoid capture
61- def $subst_deftyp(s, VARIANT (m `: t `- `{q*} pr*)*) = VARIANT (m `: $subst_typ(s, t) `- `{$subst_quant(s, b )*} $subst_prem(s, pr)*)* ;; TODO: avoid capture
60+ def $subst_deftyp(s, STRUCT (a `: t `- `{q*} pr*)*) = STRUCT (a `: $subst_typ(s, t) `- `{$subst_quant(s, q )*} $subst_prem(s, pr)*)* ;; TODO: avoid capture
61+ def $subst_deftyp(s, VARIANT (m `: t `- `{q*} pr*)*) = VARIANT (m `: $subst_typ(s, t) `- `{$subst_quant(s, q )*} $subst_prem(s, pr)*)* ;; TODO: avoid capture
6262
6363
6464;; Iterators
@@ -149,20 +149,6 @@ def $subst_prem(s, LET e_1 `= e_2) = LET $subst_exp(s, e_1) `= $subst_exp(s, e_2
149149def $subst_prem(s, ITER pr it (x `<- e)*) = ITER $subst_prem(s, pr) $subst_iter(s, it) (x `<- $subst_exp(s, e))* ;; TODO: avoid capture
150150
151151
152- ;; Constructing substitutions for parameters
153-
154- def $arg_for_param(arg, param) : subst
155- def $arg_for_param(EXP e, EXP x `: t) = {EXP (x, e)}
156- def $arg_for_param(TYP t, TYP x) = {TYP (x, t)}
157- def $arg_for_param(FUN y, FUN x `: p* `-> t) = {FUN (x, y)}
158- def $arg_for_param(GRAM g, GRAM x `: p* `-> t) = {GRAM (x, g)}
159-
160- def $args_for_params(arg*, param*) : subst
161- def $args_for_params(eps, eps) = {}
162- def $args_for_params(a_1 a*, p_1 p*) = s ++ $args_for_params(a*, $subst_param(s, p)*)
163- -- if s = $arg_for_param(a_1, p_1)
164-
165-
166152;; Well-formedness
167153
168154def $paramarg(param) : arg
0 commit comments