coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Kenneth Roe <kendroe AT hotmail.com>
- To: Coq-Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Creating a tactic that changes a conclusion
- Date: Tue, 3 Oct 2017 13:20:35 +0000
- Accept-language: en-US
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=kendroe AT hotmail.com; spf=Pass smtp.mailfrom=kendroe AT hotmail.com; spf=Pass smtp.helo=postmaster AT NAM03-BY2-obe.outbound.protection.outlook.com
- Ironport-phdr: 9a23:ndCQiR/xIZFdmP9uRHKM819IXTAuvvDOBiVQ1KB+1e8cTK2v8tzYMVDF4r011RmSAtWdtqoMotGVmp6jcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS46tL2HV91a19Hs5Hgj1fV5+If2wEYrPhey20fqz8tvdeVMbqiC6ZOZRIROwoBnR/vMRjMM2Kas3xgHOr1NIfPhTzGJsY1mUmkCvtY+L4Jd//nEI6Loa/MlaXPCicg==
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Sent: Tuesday, October 3, 2017 6:00 AM
To: Coq-Club
Subject: Re: [Coq-Club] Creating a tactic that changes a conclusion
let test_nat = lazy (Lib_coq.init_constant ["Coq" ; "Init"; "Datatypes"] "nat")
let test_eq = lazy (Lib_coq.init_constant ["Coq";"Init";"Logic"] "eq")
let test_term = Term.mkApp (Lazy.force test_eq, [|(Lazy.force test_nat);Lib_coq.Nat.of_int 2;Lib_coq.Nat.of_int 3|])
(* Top-level arewrite functionality *)
let arewrite : unit Proofview.tactic =
Proofview.Goal.enter (fun gl ->
let concl = Proofview.Goal.raw_concl gl in
let (evm, env) = Lemmas.get_current_context() in
(*let (body, _) = Constrintern.interp_constr env evm concl in*)
let _ = print "******* BEGIN *******" in
let ast = apply_to_definition build_ast env 0 test_term in
let _ = print ast in
let _ = print "******* MIDDLE *******" in
let ast = apply_to_definition build_ast env 0 concl in
let _ = print ast in
let _ = print "******* END *******" in
(print_string "This is a test";
(*Tacticals.New.tclFAIL 1
(Pp.str "The tactic is not imlplemented.")*)
Tacticals.New.tclTHENLIST
[
(** Our list of tactics consists in the following single
tactic, that changes the conclusion of the goal to
[concl'] if [concl] and [concl'] are convertible.
(see [tactics/tactis.mli] for other tactics.) *)
Tactics.change_concl test_term ;
]))
end
Sent: Tuesday, October 3, 2017 5:46 AM
To: Coq-Club
Subject: [Coq-Club] Creating a tactic that changes a conclusion
a, b, c : nat
============================
eval (c :: (b :: a :: nil)%list)
(a_plus (a_plus (a_var 1) (a_var 0)) (a_const 1)) <=
eval (c :: (b :: a :: nil)%list) (a_var 2)
a, b, c : nat
============================
2=3
let test_eq = lazy (Lib_coq.init_constant ["Coq";"Init";"Logic"] "eq")
let test_term = Term.mkApp (Lazy.force test_eq, [|Lib_coq.Nat.of_int 2;Lib_coq.Nat.of_int 3|])
(* Top-level arewrite functionality *)
let arewrite : unit Proofview.tactic =
Proofview.Goal.enter (fun gl ->
let concl = Proofview.Goal.raw_concl gl in
let (evm, env) = Lemmas.get_current_context() in
(*let (body, _) = Constrintern.interp_constr env evm concl in*)
let _ = print "******* BEGIN *******" in
let ast = apply_to_definition build_ast env 0 test_term in
let _ = print ast in
let _ = print "******* MIDDLE *******" in
let ast = apply_to_definition build_ast env 0 concl in
let _ = print ast in
let _ = print "******* END *******" in
(print_string "This is a test";
(*Tacticals.New.tclFAIL 1
(Pp.str "The tactic is not imlplemented.")*)
Tacticals.New.tclTHENLIST
[
(** Our list of tactics consists in the following single
tactic, that changes the conclusion of the goal to
[concl'] if [concl] and [concl'] are convertible.
(see [tactics/tactis.mli] for other tactics.) *)
Tactics.change_concl test_term ;
]))
end
- [Coq-Club] Creating a tactic that changes a conclusion, Kenneth Roe, 10/03/2017
- Re: [Coq-Club] Creating a tactic that changes a conclusion, Kenneth Roe, 10/03/2017
- Re: [Coq-Club] Creating a tactic that changes a conclusion, Kenneth Roe, 10/03/2017
- Re: [Coq-Club] Creating a tactic that changes a conclusion, Matthieu Sozeau, 10/03/2017
- Re: [Coq-Club] Creating a tactic that changes a conclusion, Kenneth Roe, 10/03/2017
- Re: [Coq-Club] Creating a tactic that changes a conclusion, Kenneth Roe, 10/03/2017
Archive powered by MHonArc 2.6.18.