Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Constructing a match expression inside an ml tactic

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Constructing a match expression inside an ml tactic


Chronological Thread 
  • From: Kenneth Roe <kendroe AT hotmail.com>
  • To: Coq-Club <coq-club AT inria.fr>
  • Subject: [Coq-Club] Constructing a match expression inside an ml tactic
  • Date: Mon, 9 Oct 2017 01:42:54 +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 NAM02-CY1-obe.outbound.protection.outlook.com
  • Ironport-phdr: 9a23:TP+SrhaYeEL83RYUNBuQkJn/LSx+4OfEezUN459isYplN5qZpsq/bnLW6fgltlLVR4KTs6sC0LWG9f24EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i76vnYuHUDUMhMwDeDoEMaGhMOukuu25pf7YgNShTP7b6kkfzusqgCElcQQh4Z+Ku4LzRaB9nhFfehMwm5AJVWPmh/94oG7+5s1oHcYgO4o68MVCfayRK8/V7ENVDk=
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

I have an ml tactic that has a shell that looks like the following:

let arewrite : unit Proofview.tactic =

  Proofview.Goal.enter (fun gl ->

  let concl = Proofview.Goal.raw_concl gl in

  let e' = ...

  let (evm, env) = Lemmas.get_current_context() in

          Tacticals.New.tclTHENLIST

            [

              Equality.replace concl (build_predicate e' []) ;

            ]))

end



Inside it there is a call to a function build_predicate.  This function needs to build a predicate that contains a match clause.  I found that the record for a match clause contains a match info field.  I'm using the following two lines of code to build the match constructor:

    let ci = make_case_info Global.env ind RegularStyle in

    mkCase (ci, tterm, eterm, Array.of_list terms)


The "ci" field seems to contain information I need to pull from the global environment.  I was able to figure out the first and third parameters by looking at pieces of code in Coq.  However, I'm not able to figure out what to do with the "ind" field.  What do I fill in for ind?

                 - Ken




Archive powered by MHonArc 2.6.18.

Top of Page