Skip to content

Commit f03ea12

Browse files
committed
remove tyd_resolve (can use import mechanism instead)
1 parent 07c3617 commit f03ea12

8 files changed

Lines changed: 14 additions & 26 deletions

File tree

src/ecDecl.ml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ type ty_params = ty_param list
1616
type ty_pctor = [ `Int of int | `Named of ty_params ]
1717

1818
type tydecl = {
19-
tyd_params : ty_params;
20-
tyd_type : ty_body;
21-
tyd_loca : locality;
22-
tyd_resolve : bool;
19+
tyd_params : ty_params;
20+
tyd_type : ty_body;
21+
tyd_loca : locality;
2322
}
2423

2524
and ty_body = [
@@ -48,7 +47,7 @@ let tydecl_as_record (td : tydecl) =
4847
match td.tyd_type with `Record x -> Some x | _ -> None
4948

5049
(* -------------------------------------------------------------------- *)
51-
let abs_tydecl ?(resolve = true) ?(tc = Sp.empty) ?(params = `Int 0) lc =
50+
let abs_tydecl ?(tc = Sp.empty) ?(params = `Int 0) lc =
5251
let params =
5352
match params with
5453
| `Named params ->
@@ -60,7 +59,7 @@ let abs_tydecl ?(resolve = true) ?(tc = Sp.empty) ?(params = `Int 0) lc =
6059
(EcUid.NameGen.bulk ~fmt n)
6160
in
6261

63-
{ tyd_params = params; tyd_type = `Abstract tc; tyd_resolve = resolve; tyd_loca = lc; }
62+
{ tyd_params = params; tyd_type = `Abstract tc; tyd_loca = lc; }
6463

6564
(* -------------------------------------------------------------------- *)
6665
let ty_instanciate (params : ty_params) (args : ty list) (ty : ty) =

src/ecDecl.mli

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ type ty_params = ty_param list
1212
type ty_pctor = [ `Int of int | `Named of ty_params ]
1313

1414
type tydecl = {
15-
tyd_params : ty_params;
16-
tyd_type : ty_body;
17-
tyd_loca : locality;
18-
tyd_resolve : bool;
15+
tyd_params : ty_params;
16+
tyd_type : ty_body;
17+
tyd_loca : locality;
1918
}
2019

2120
and ty_body = [
@@ -36,7 +35,7 @@ val tydecl_as_abstract : tydecl -> Sp.t option
3635
val tydecl_as_datatype : tydecl -> ty_dtype option
3736
val tydecl_as_record : tydecl -> (form * (EcSymbols.symbol * EcTypes.ty) list) option
3837

39-
val abs_tydecl : ?resolve:bool -> ?tc:Sp.t -> ?params:ty_pctor -> locality -> tydecl
38+
val abs_tydecl : ?tc:Sp.t -> ?params:ty_pctor -> locality -> tydecl
4039

4140
val ty_instanciate : ty_params -> ty list -> ty -> ty
4241

src/ecEnv.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3026,9 +3026,7 @@ module Theory = struct
30263026
30273027
match item.ti_item with
30283028
| Th_type (x, ty) ->
3029-
if ty.tyd_resolve
3030-
then MC.import_tydecl (xpath x) ty env
3031-
else env
3029+
MC.import_tydecl (xpath x) ty env
30323030
30333031
| Th_operator (x, op) ->
30343032
MC.import_operator (xpath x) op env

src/ecHiInductive.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ let trans_datatype (env : EcEnv.env) (name : ptydname) (dt : pdatatype) =
8686
tyd_params = EcUnify.UniEnv.tparams ue;
8787
tyd_type = `Abstract EcPath.Sp.empty;
8888
tyd_loca = lc;
89-
tyd_resolve = true;
9089
} in
9190
EcEnv.Ty.bind (unloc name) myself env
9291
in

src/ecScope.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ module Ty = struct
16081608
record.ELI.rc_tparams, `Record (scheme, record.ELI.rc_fields)
16091609
in
16101610

1611-
bind scope (unloc name, { tyd_params; tyd_type; tyd_loca; tyd_resolve = true; })
1611+
bind scope (unloc name, { tyd_params; tyd_type; tyd_loca; })
16121612

16131613
(* ------------------------------------------------------------------ *)
16141614
let bindclass ?(import = true) (scope : scope) (x, tc) =
@@ -1639,8 +1639,7 @@ module Ty = struct
16391639
let body = ofold (fun p tc -> Sp.add p tc) Sp.empty uptc in
16401640
{ tyd_params = [];
16411641
tyd_type = `Abstract body;
1642-
tyd_loca = (lc :> locality);
1643-
tyd_resolve = true; } in
1642+
tyd_loca = (lc :> locality); } in
16441643
let scenv = EcEnv.Ty.bind name asty scenv in
16451644

16461645
(* Check for duplicated field names *)

src/ecSection.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,7 @@ let generalize_tydecl to_gen prefix (name, tydecl) =
786786
let to_gen = { to_gen with tg_subst} in
787787
let tydecl = {
788788
tyd_params; tyd_type;
789-
tyd_loca = `Global;
790-
tyd_resolve = tydecl.tyd_resolve } in
789+
tyd_loca = `Global; } in
791790
to_gen, Some (Th_type (name, tydecl))
792791

793792
| `Declare ->

src/ecSubst.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,6 @@ let subst_tydecl (s : subst) (tyd : tydecl) =
883883

884884
{ tyd_params = tparams;
885885
tyd_type = body;
886-
tyd_resolve = tyd.tyd_resolve;
887886
tyd_loca = tyd.tyd_loca; }
888887

889888
(* -------------------------------------------------------------------- *)

src/ecTheoryReplay.ml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ let rec replay_tyd (ove : _ ovrenv) (subst, ops, proofs, scope) (import, x, otyd
337337
let decl =
338338
{ tyd_params = nargs;
339339
tyd_type = `Concrete ntyd;
340-
tyd_resolve = otyd.tyd_resolve && (mode = `Alias);
341340
tyd_loca = otyd.tyd_loca; }
342341

343342
in (decl, ntyd)
@@ -347,10 +346,7 @@ let rec replay_tyd (ove : _ ovrenv) (subst, ops, proofs, scope) (import, x, otyd
347346
| Some reftyd ->
348347
let tyargs = List.map (fun (x, _) -> EcTypes.tvar x) reftyd.tyd_params in
349348
let body = tconstr p tyargs in
350-
let decl =
351-
{ reftyd with
352-
tyd_type = `Concrete body;
353-
tyd_resolve = otyd.tyd_resolve && (mode = `Alias); } in
349+
let decl = { reftyd with tyd_type = `Concrete body; } in
354350
(decl, body)
355351

356352
| _ -> assert false

0 commit comments

Comments
 (0)