I want to write and debug code in Coq similar to how I write code in Python, R, etc. Specifically:
I have one terminal window where my code.v file is shown, e.g.:
Definition double (x:nat) : nat := 2 * x.
Definition tripple (x:nat) : nat := 3 * x.
Now in another terminal I want to have an interactive shell that could accept commands
to load the code from a code.v, check it, etc. For example:
Load code.v // What's the command for this?
Print double. // Expect to see output "double : nat -> nat"
Question 1: what kind of command provides me such interactive shell and what command should I execute in the interactive shell to load a file?
Moreover, if in my code.v file I have an unfinished proof, e.g.
Lemma ex4: forall (X : Set) (P : X -> Prop),
~(forall x, ~ (P x)) -> (exists x, (P x)).
Proof.
intros X P A.
apply not_all_ex_not in A.
destruct A.
Question 2: Is there a command from an interactive shell like check code.v which would print me a state of my proof, like Coqide does when you press ctrl+down
1 subgoal
X : Set
P : X -> Prop
x : X
H : ~ ~ P x
______________________________________(1/1)
exists x0 : X, P x0
Note that I prefer to do everything through linux terminals, rather than using an IDE.