| ((C.Appl ((C.MutConstruct (uri1,typeno1,consno1,exp_named_subst1))::_)),
(C.Appl ((C.MutConstruct (uri2,typeno2,consno2,exp_named_subst2))::_)))
when (consno1 <> consno2) || (exp_named_subst1 <> exp_named_subst2) ->
- (* raise (ProofEngineTypes.Fail "Injection: not a projectable equality but a discriminable one") ; *) T.id_tac
- | _ -> (* raise (ProofEngineTypes.Fail "Injection: not a projectable equality") ; *) T.id_tac
+ raise (ProofEngineTypes.Fail (lazy "Injection: not a projectable equality but a discriminable one"))
+ | _ -> raise (ProofEngineTypes.Fail (lazy "Injection: not a projectable equality"))
)
| _ -> raise (ProofEngineTypes.Fail (lazy "Injection: not a projectable equality"))
)
| C.Prod (binder,source,target) when k > paramsno ->
let binder' =
match binder with
- C.Name b -> C.Name b
+ C.Name _ -> binder
| C.Anonymous ->
C.Name
(incr seed; "y" ^ string_of_int !seed)
in aux reduced_cty 1
) constructor_list in
let outtype =
+ let seed = ref 0 in
let rec to_lambdas te head =
match CicReduction.whd context te with
- | C.Prod (name,so,ta) ->
- C.Lambda (name,so,to_lambdas ta head)
+ | C.Prod (binder,so,ta) ->
+ let binder' =
+ match binder with
+ C.Name _ -> binder
+ | C.Anonymous ->
+ C.Name (incr seed; "d" ^ string_of_int !seed)
+ in
+ C.Lambda (binder',so,to_lambdas ta head)
| _ -> head in
let rec skip_prods n te =
match n, CicReduction.whd context te with
~start:(P.cut_tac (C.Appl [(C.MutInd (equri,0,[])) ; tty' ; t1' ; t2']))
~continuations:[
T.then_
- ~start:(injection_tac ~term:(C.Rel 1))
+ ~start:T.id_tac (*(injection_tac ~term:(C.Rel 1))*)
~continuation:T.id_tac (* !!! qui devo anche fare clear di term tranne al primo passaggio *)
;
T.then_
status
| _ -> raise (ProofEngineTypes.Fail (lazy "Injection: not an equality over elements of an inductive type"))
)
- | _ -> ProofEngineTypes.apply_tactic T.id_tac status (*XXXraise (ProofEngineTypes.Fail (lazy "Injection: not an equality"))*)
+ | _ -> raise (ProofEngineTypes.Fail (lazy "Injection: not an equality"))
in
ProofEngineTypes.mk_tactic (injection1_tac ~term ~i)
;;
tempty: ttree nat
| tnode : ∀A. ttree A → ttree A → ttree A.
+(* CSC: there is an undecidable unification problem here:
+ consider a constructor k : \forall x. f x -> i (g x)
+ The head of the outtype of the injection MutCase should be (f ?1)
+ such that (f ?1) unifies with (g d) [ where d is the Rel that binds
+ the corresponding right parameter in the outtype ]
+ Coq dodges the problem by generating an equality between sigma-types
+ (that state the existence of a ?1 such that ...)
theorem injection_test3:
∀t,t'. tnode nat t tempty = tnode nat t' tempty → t = t'.
intros;
t = t'.
intros;
injection H;
-
+*)
theorem injection_test4:
∀n,n',m,m'. k1 bool (S n) (S m) = k1 bool (S n') (S (S m')) → m = S m'.
intros;
injection H;
assumption.
-qed.
-
-
+qed.
\ No newline at end of file