You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|App({ it = Constc }, [x]) whenF.equal c F.spillf ->
@@ -913,9 +913,9 @@ end = struct
913
913
else
914
914
let bound =F.Set.mem c ctx in
915
915
if bound thenScopedTerm.App(ScopedTerm.mk_bound_const ~lang:elpi_language c ~loc:cloc, xs)
916
-
elseif is_uvar_name c thenScopedTerm.Var(ScopedTerm.mk_bound_const ~lang:elpi_var c ~loc:cloc,xs)
917
-
elseif is_global c thenScopedTerm.App(ScopedTerm.mk_const ~scope:(Scope.mkGlobal ~escape_ns:true()) (of_global c) ~loc:cloc,xs)
918
-
elseScopedTerm.App(ScopedTerm.mk_const ~scope:(Scope.mkGlobal ()) c ~loc:cloc, xs)
916
+
elseif is_uvar_name c thenScopedTerm.UVar(ScopedTerm.mk_uvar c ~loc:cloc,xs)
917
+
elseif is_global c thenScopedTerm.App(ScopedTerm.mk_global_const ~escape_ns:true (of_global c) ~loc:cloc,xs)
918
+
elseScopedTerm.App(ScopedTerm.mk_global_const c ~loc:cloc, xs)
919
919
|Cast (t,ty) ->
920
920
let t = scope_loc_term ~state ctx t in
921
921
let ty = scope_loc_tye F.Set.empty (RecoverStructure.structure_type_expression ty.Ast.TypeExpression.tloc Ast.Structured.Relation valid_functional ty) in
@@ -926,7 +926,7 @@ end = struct
926
926
|Lam (c,cloc,ty,b) ->
927
927
if has_dot c then error ~loc"Bound variables cannot contain the namespaec separator '.'";
928
928
let ty = ty |>Option.map (funty -> scope_loc_tye F.Set.empty (RecoverStructure.structure_type_expression ty.Ast.TypeExpression.tloc Ast.Structured.Relation valid_functional ty)) in
929
-
let name =Some (ScopedTerm.mk_const ~scope:elpi_language c ~loc:cloc) in
929
+
let name =Some (ScopedTerm.mk_binder ~lang:elpi_language c ~loc:cloc) in
930
930
ScopedTerm.Lam (name,ty,scope_loc_term ~state (F.Set.add c ctx) b)
931
931
|CDatac -> ScopedTerm.CData c (* CData.hcons *)
932
932
|App ({ it = Lam_},_) ->
@@ -1173,9 +1173,9 @@ module Flatten : sig
1173
1173
let b' = aux_loc b in
1174
1174
let ty' = option_smart_map (ScopedTypeExpression.smart_map_scoped_loc_ty tyf) ty in
1175
1175
if b == b' && ty' == ty then it elseLam(n,ty',b')
1176
-
|Var(c,l) ->
1176
+
|UVar(c,l) ->
1177
1177
let l' = smart_map aux_loc l in
1178
-
if l == l' then it elseVar(c,l')
1178
+
if l == l' then it elseUVar(c,l')
1179
1179
|Cast(t,ty) ->
1180
1180
let t' = aux_loc t in
1181
1181
let ty' =ScopedTypeExpression.smart_map_scoped_loc_ty tyf ty in
@@ -1642,7 +1642,7 @@ end = struct
1642
1642
let allocate_global_symbol = allocate_global_symbol types symb state in
1643
1643
letpush_bound (n,ctx) c= (n+1,Scope.Map.add c n ctx) in
1644
1644
letpush_unnamed_bound (n,ctx) = (n+1,ctx) in
1645
-
letpushctx : string ScopedTerm.const option -> 'a =function
1645
+
letpushctx : ScopedTerm.binder option -> 'a =function
1646
1646
|None -> push_unnamed_bound ctx
1647
1647
|Some{ scope = l; name = x } -> push_bound ctx (x,l) in
1648
1648
letopenScopedTermin
@@ -1690,7 +1690,7 @@ end = struct
1690
1690
let xs =List.map (todbl ctx) xs in
1691
1691
D.mkApp c x xs
1692
1692
(* holes *)
1693
-
|Var({ name = c },xs) ->
1693
+
|UVar({ name = c },xs) ->
1694
1694
let xs =List.map (todbl ctx) xs in
1695
1695
R.mkAppArg (allocate_arg c) 0 xs
1696
1696
|Discard -> D.mkDiscard
@@ -2560,7 +2560,7 @@ let info_of_scoped_term ~types t =
2560
2560
letrec auxlocty=function
2561
2561
|Impl(_,locs,l,r) -> log_bsymb locs Global_symbols.impl; log_ty loc ty; aux_loc l; aux_loc r
2562
2562
|Discard -> log_ty loc ty
2563
-
|Var({ scope = s; ty = tys; loc = locs},args) -> if args <>[]then log_ty loc ty; log_symb locs s (TypeAssignment.deref_opt tys); List.iter aux_loc args
2563
+
|UVar({ scope = s; ty = tys; loc = locs},args) -> if args <>[]then log_ty loc ty; log_symb locs (Scope.Bound elpi_var) (TypeAssignment.deref_opt tys); List.iter aux_loc args
2564
2564
|App({ scope = s; ty = tys; loc = locs},args) -> if args <>[]then log_ty loc ty; log_symb locs s (TypeAssignment.deref_opt tys); List.iter aux_loc args
letget_lam_name=functionNone ->F.from_string "_"|Some (n,_) -> n
957
961
letmk_empty_lam_type=function
958
962
|None -> None
959
-
|Some (name, loc, scope) -> Some (mk_const name ~scope~loc)
963
+
|Some (name, loc, scope) -> Some (mk_w_ty_loc name ~scope~loc)
960
964
961
965
(* The type of the object being constructed is irrelevant since
962
966
build_infix_constant is used in the pretty printer of term and the type
@@ -994,8 +998,8 @@ module ScopedTerm = struct
994
998
|App({ name = f },x::xs) whenF.equal F.pif f ||F.equal F.sigmaf f -> fprintf fmt "@[<hov 2>%a@ %a@]"F.pp f (Util.pplist ~pplastelem:(pretty_parens_lam ~lvl:app) (pretty_parens ~lvl:app) "") (x::xs)
995
999
|App({ scope = Global_; name = f }asn,x::xs) when is_infix_constant f -> fprintf fmt "%a" (Util.pplist ~boxed:true (pretty_parens ~lvl:0) "") (intersperse (build_infix_constant n) (x::xs))
996
1000
|App({ name = f },x::xs) -> fprintf fmt "@[<hov 2>%a@ %a@]"F.pp f (Util.pplist ~boxed:true (pretty_parens ~lvl:app) "") (x::xs)
997
-
|Var({ name = f },[]) -> fprintf fmt "@[%a@]"F.pp f
998
-
|Var({ name = f },xs) -> fprintf fmt "@[%a@ %a@]"F.pp f (Util.pplist ~boxed:true (pretty_parens ~lvl:app) "") xs
1001
+
|UVar({ name = f },[]) -> fprintf fmt "@[%a@]"F.pp f
1002
+
|UVar({ name = f },xs) -> fprintf fmt "@[%a@ %a@]"F.pp f (Util.pplist ~boxed:true (pretty_parens ~lvl:app) "") xs
0 commit comments