Is there a way to print the value of a variable (whether a hypothesis, tactic, term) in the middle of an Ltac procedure?
Is "printf-debugging" possible in Ltac?
488 views Asked by Carl Patenaude Poulin At
1
There are 1 answers
Related Questions in COQ
- Coq : mutually recursive definitions with [mrec] in InteractionTrees Library
- Is there a function that returns a list of values with specific type in OCaml?
- How to prove (X !-> 3) =[ <{ X := X + 2 }> ]=> (X !-> 5)?
- Showing polynomial equality in coq/ssreflect
- Syntax of the case tactic in coq
- Why assuming singleton elimination and definitional proof irrelevance leads to UIP, in Coq?
- Understanding nat_ind2 in Logical Foundations
- What `dependent induction` tactic does in Coq and how to use it
- Split multiple conjuncts in the goal
- Coq can't define an inductive proposition
- Coq Decreasing Argument mapping
- The `specialize` tatic in Coq does not work well with typeclasses?
- Multiple Assignements in a Coq Map to the same value
- Decider for lists In Fixpoint
- VSCoq Error: Connection to server got closed. Server will not be restarted
Related Questions in LTAC
- Coq/Ltac: is it possible to design a tactic that says the goal is proved when a decision procedure proves it, without the proof term?
- Clear hypotheses after recursive Ltac
- Ltac tactic that accepts an arbitrary number of quantifiers
- `fresh` name: use match result if variable, do something else if it's a constant
- How to create a custom Ltac to recursively destruct conjunctions?
- Why does Ltac not match the clause?
- Coq: How are the equality tacticts symmetry and transitivity defined?
- Adding "in" part to tactic to specify where to apply it
- Destruct hypothesis: general case
- Coq match on Hypothesis passed to Ltac tactic
- apply ltac to subexpression of a goal
- Coq: Ltac for transitivity of implication (a.k.a. hypothetical syllogism)
- Is it possible to turn a context pattern into a Gallina function?
- Does Isabelle/HOL have its tactic language?
- Is it possible to bind necessarily different terms in Ltac-match?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Yes, use the
idtactactic.You can pass
idtaca constant string to print. It can also print identifiers (like hypothesis names) if you pattern match them, and it can print their types if you get access to them with pattern matching ortype of. You can also print terms or the contents of Ltac let-bound variables. Finally, you can passidtacmultiple arguments to print them all out. You mentioned printing tactics - this is one thing that unfortunately you can't print withidtac. If you try to, you'll just get <tactic closure>.Here are a bunch of examples:
Goal True -> False. intro Htrue. idtac "hello world". (* prints hello world *) match goal with | [ H: True |- _ ] => idtac H (* prints Htrue *) end. match goal with | |- ?g => idtac g (* prints False *) end. let t := type of Htrue in idtac t. (* prints True *) let x := constr:(1 + 1) in idtac x. (* prints (1 + 1) *) idtac "hello" "there". (* prints hello there *) (* note that this is an Ltac-level function, not a Gallina function *) let x := (fun _ => fail) in idtac x. (* prints <tactic closure> *) Abort.