Skip to content

Commit 6804d83

Browse files
oskgostrub
authored andcommitted
switch axiom replay to use exact rather than a custom apply variant
1 parent 053ee6e commit 6804d83

4 files changed

Lines changed: 13 additions & 24 deletions

File tree

src/ecHiGoal.ml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -562,25 +562,6 @@ let process_apply_bwd ~implicits mode (ff : ppterm) (tc : tcenv1) =
562562
with (EcLowGoal.Apply.NoInstance _) as err ->
563563
tc_error_exn !!tc err
564564

565-
(* -------------------------------------------------------------------- *)
566-
let process_exacttype qs (tc : tcenv1) =
567-
let env, hyps, _ = FApi.tc1_eflat tc in
568-
let p =
569-
try EcEnv.Ax.lookup_path (EcLocation.unloc qs) env
570-
with LookupFailure cause ->
571-
tc_error !!tc "%a" EcEnv.pp_lookup_failure cause
572-
in
573-
let tys =
574-
List.map (fun a -> EcTypes.tvar a)
575-
(EcEnv.LDecl.tohyps hyps).h_tvar in
576-
let pt = ptglobal ~tys p in
577-
578-
try
579-
EcLowGoal.t_apply pt tc
580-
with InvalidGoalShape ->
581-
let ppe = EcPrinting.PPEnv.ofenv env in
582-
tc_error !!tc "cannot apply %a@." (EcPrinting.pp_axname ppe) p
583-
584565
(* -------------------------------------------------------------------- *)
585566
let process_apply_fwd ~implicits (pe, hyp) tc =
586567
let module E = struct exception NoInstance end in
@@ -2048,9 +2029,6 @@ let process_apply ~implicits ((infos, orv) : apply_t * prevert option) tc =
20482029
| `Alpha pe ->
20492030
process_apply_bwd ~implicits `Alpha pe tc
20502031

2051-
| `ExactType qs ->
2052-
process_exacttype qs tc
2053-
20542032
| `Top mode ->
20552033
let tc = process_apply_top tc in
20562034
if mode = `Exact then t_onall process_done tc else tc

src/ecParsetree.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,6 @@ type apply_info = [
10341034
| `Apply of ppterm list * [`Apply|`Exact|`Alpha]
10351035
| `Top of [`Apply|`Exact|`Alpha]
10361036
| `Alpha of ppterm
1037-
| `ExactType of pqsymbol
10381037
]
10391038

10401039
(* -------------------------------------------------------------------- *)

src/ecThCloning.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ end = struct
391391
(* ------------------------------------------------------------------ *)
392392
let ax_ovrd _oc ((proofs, evc) : state) name ((axd, mode) : ax_override) =
393393
let loc = axd.pl_loc in
394-
let tc = Papply (`ExactType axd, None) in
394+
let tc = FPNamed (axd, None) in
395+
let tc = { fp_mode = `Explicit; fp_head = tc; fp_args = []; } in
396+
let tc = Papply (`Apply ([tc], `Exact), None) in
395397
let tc = mk_loc loc (Plogic tc) in
396398
let pr = { pthp_mode = `Named (name, mode);
397399
pthp_tactic = Some tc; } in

tests/clone-parametric-axiom.ec

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
op gen ['a]: bool = true.
2+
3+
theory T.
4+
axiom ax : gen<:bool>.
5+
end T.
6+
7+
lemma lem: gen<:'a> by done.
8+
9+
clone T as T' with
10+
axiom ax <- lem.

0 commit comments

Comments
 (0)