aboutsummaryrefslogtreecommitdiff
path: root/proofs
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2016-05-16 18:34:21 +0200
committerPierre-Marie Pédrot2016-05-16 21:17:25 +0200
commit12f4c8ed277fa8368cab2e99f173339a64bcef3d (patch)
treee6a5072d1f747d0266fe7d6af9ef666b39f3dcce /proofs
parentdc8750d166cffd846619d2de20e02a4e31c6357f (diff)
Put the "fix" tactic in the monad.
Diffstat (limited to 'proofs')
-rw-r--r--proofs/logic.ml45
-rw-r--r--proofs/proof_type.mli1
-rw-r--r--proofs/tacmach.ml3
-rw-r--r--proofs/tacmach.mli2
4 files changed, 0 insertions, 51 deletions
diff --git a/proofs/logic.ml b/proofs/logic.ml
index df5a12473b..ec1b7ca869 100644
--- a/proofs/logic.ml
+++ b/proofs/logic.ml
@@ -543,51 +543,6 @@ let prim_refiner r sigma goal =
let sigma = Goal.V82.partial_solution_to sigma goal sg2 oterm in
if b then ([sg1;sg2],sigma) else ([sg2;sg1],sigma)
- | FixRule (f,n,rest,j) ->
- let rec check_ind env k cl =
- match kind_of_term (strip_outer_cast cl) with
- | Prod (na,c1,b) ->
- if Int.equal k 1 then
- try
- fst (find_inductive env sigma c1)
- with Not_found ->
- error "Cannot do a fixpoint on a non inductive type."
- else
- let open Context.Rel.Declaration in
- check_ind (push_rel (LocalAssum (na,c1)) env) (k-1) b
- | _ -> error "Not enough products."
- in
- let ((sp,_),u) = check_ind env n cl in
- let firsts,lasts = List.chop j rest in
- let all = firsts@(f,n,cl)::lasts in
- let rec mk_sign sign = function
- | (f,n,ar)::oth ->
- let ((sp',_),u') = check_ind env n ar in
- if not (eq_mind sp sp') then
- error "Fixpoints should be on the same mutual inductive declaration.";
- if !check && mem_named_context f (named_context_of_val sign) then
- errorlabstrm "Logic.prim_refiner"
- (str "Name " ++ pr_id f ++ str " already used in the environment");
- mk_sign (push_named_context_val (LocalAssum (f,ar)) sign) oth
- | [] ->
- Evd.Monad.List.map (fun (_,_,c) sigma ->
- let gl,ev,sig' =
- Goal.V82.mk_goal sigma sign c (Goal.V82.extra sigma goal) in
- (gl,ev),sig')
- all sigma
- in
- let (gls_evs,sigma) = mk_sign sign all in
- let (gls,evs) = List.split gls_evs in
- let ids = List.map pi1 all in
- let evs = List.map (Vars.subst_vars (List.rev ids)) evs in
- let indxs = Array.of_list (List.map (fun n -> n-1) (List.map pi2 all)) in
- let funnames = Array.of_list (List.map (fun i -> Name i) ids) in
- let typarray = Array.of_list (List.map pi3 all) in
- let bodies = Array.of_list evs in
- let oterm = Term.mkFix ((indxs,0),(funnames,typarray,bodies)) in
- let sigma = Goal.V82.partial_solution sigma goal oterm in
- (gls,sigma)
-
| Cofix (f,others,j) ->
let rec check_is_coind env cl =
let b = whd_betadeltaiota env sigma cl in
diff --git a/proofs/proof_type.mli b/proofs/proof_type.mli
index 48ad50c7a0..ea3b5242da 100644
--- a/proofs/proof_type.mli
+++ b/proofs/proof_type.mli
@@ -19,7 +19,6 @@ open Misctypes
type prim_rule =
| Cut of bool * bool * Id.t * types
- | FixRule of Id.t * int * (Id.t * int * constr) list * int
| Cofix of Id.t * (Id.t * constr) list * int
| Refine of constr
| Move of Id.t * Id.t move_location
diff --git a/proofs/tacmach.ml b/proofs/tacmach.ml
index 67daccb81d..8eb8b2cec6 100644
--- a/proofs/tacmach.ml
+++ b/proofs/tacmach.ml
@@ -124,9 +124,6 @@ let refine_no_check c gl =
let move_hyp_no_check id1 id2 gl =
refiner (Move (id1,id2)) gl
-let mutual_fix f n others j gl =
- with_check (refiner (FixRule (f,n,others,j))) gl
-
let mutual_cofix f others j gl =
with_check (refiner (Cofix (f,others,j))) gl
diff --git a/proofs/tacmach.mli b/proofs/tacmach.mli
index fef205f823..e2d8bfc6ef 100644
--- a/proofs/tacmach.mli
+++ b/proofs/tacmach.mli
@@ -86,8 +86,6 @@ val pf_is_matching : goal sigma -> constr_pattern -> constr -> bool
val refiner : rule -> tactic
val internal_cut_no_check : bool -> Id.t -> types -> tactic
val refine_no_check : constr -> tactic
-val mutual_fix :
- Id.t -> int -> (Id.t * int * constr) list -> int -> tactic
val mutual_cofix : Id.t -> (Id.t * constr) list -> int -> tactic
(** {6 The most primitive tactics with consistency and type checking } *)