How to run SearchAbout snippet in company-coq-tutorial - emacs

Running M-x company-coq-tutorial, I'm getting stuck at the following instruction in the tutorial:
(* Run the following snippet, then try typing ‘plus’ *)
SearchAbout eq.
I'm assuming it's supposed to be Search eq. in newer versions of Coq.
How do I "run" this snippet? Does the tutorial want me to go to the line below Search eq. and press C-c C-RET, or is there something else I'm supposed to do?

Related

Is there a way to redirect Coqide messages and errors to the same output?

I have a tactic whose expected behavior is to output an error message, and I want to run it in batch mode on a series of goals and for each goal, I want to record the goal and the error message from the tactic. It seems like I can't do this with coqc since it will not continue on failure, so I'm doing this on Coqide. The closest I've been able to come to a solution is to have my file to have goals that look like this:
Theorem/Lemma blah.
Proof. Show. my_tactic. Admitted.
The first problem with this is that Show doesn't retain the proof goals in the Messages tab of Coqide through the run of the file, and the second is that while the output of the tactic is retained in the Errors tab, I am not able to copy it. Any help would be appreciated. Thanks!
Try using the "Fail" command. This is with 8.13 (with master the contexts and errors are not correctly interleaved). I didn't try 8.14-8.17. You need to run all of the input with "run to end" or "run to cursor"; single stepping will block you at the first error:
Fail command example

Coq + Emacs? ``Check`` can't see what is defined in the source file

So I am playing with Coq using Emacs as the IDE. Both proof-general and company-coq are installed and load correctly.
Then I open dummy whatever_name.v file and define recursive function using the Fixpoint keyword.
Then I run coq-Check on it and get:
> Check addnm .
Error: The reference addnm was not found in the current environment.
However, for example, Inductive unit : Set := tt. works perfectly well.
What am I doing wrong?
I have the impression you did not ask Coq to read the addnm definition. Try pressing C-c C-n on your Coq buffer. This should instruct Proof General to send in the next command to Coq for processing. You should see your buffer progressively turning a different color as the commands are sent. Once the definition of addnm is highlighted, you should be able to check it (C-c C-a C-c).
(The reason unit still works is that its definition is automatically loaded when you start Coq in Emacs.)

Avoid printing notation in Coq with Proof General

In lecture 6 of the DeepSpec 2018, the lecturer Checks the definition of
string_dec
obtaining:
string_dec
: forall s1 s2 : string, {s1 = s2} + {s1 <> s2}
Then he goes on to see the definition of +, but before, he disables in CoqIde the printing of notation. So that sumbool is printed. This last symbol can be checked.
How can I do the same thing with Proof General?
You can use the menu, Coq > OPTIONS > Set Printing All.
You can also issue the command directly, typing Set Printing All. and evaluating it in your buffer before running the Check command. This also gives you access to Unset Printing Notations to only disable printing notations (which is something you can do with the menu in CoqIDE). When you're done you can just delete this command, which will undo its effect.
Finally, you can also directly use Coq > OTHER QUERIES > Check (show all) on string_dec.

How to get coq to print out new goal and hypotheses after applying tactic

sometimes I find coq gets into a state where when I apply a tactic, the new goal and hypotheses don't automatically get printed out. How do I set it to print these out after each tactic invocation.
This is coq 8.7.2, using coqtop
I believe when this happens it's a bug in Proof General, which is supposed to display the proof context whenever you're in the middle of a proof. Li-yao Xia's solution of hitting C-c C-p should work.

Remove arrow in Emacs' ProofGeneral mode for Coq

I'm using ProofGeneral with Coq. When I do C-c C-return, Emacs highlights the area Coq has processed. This is nice. However, it inserts a '=>' on the next line, which overwrites the first two characters of your input. For example, currently I'm looking at
Inductive Seq : Set :=
| MkSeq : Ants -> Form -> Seq.
=>ductive Prf : Set :=
| Init :
How can I get rid of that arrow?
Update:
I learned that if I turn fringe-mode on, the arrow is in the fringe and I can see all my typing. I still want to kill it though. Thanks!
Aha, just found it. This is an Emacs configuration, not a Proof General one, given in the overlay-arrow-string variable. To turn it off, just set the variable to "" in your Emacs configuration puttng this in your .emacs:
(setq overlay-arrow-string "")