Before this commit, an user could define their own prelude and change
the types of quot, quot.mk, quot.lift or quot.ind.
By doing that, they could prove false.
This commit prevents this kind of abuse.
It also modifies the definition of `quot` and avoids the `setoid`
dependency.
The previous `quot` type is now called `quotient`, and it is defined
using the new `quot` type provided by the kernel.
See discussion at #1330
After this commit, new interactice tactic classes can be added without
writing C++ code (see example: tests/lean/run/my_tac_class.lean).
The tactic_evaluator was simplified, and all the complexity has been
moved to tactic_notation, and lean code.
We can now inspect the intermediate states produced by the rewrite
tactic.
The function (@scope_trace _ line col thunk) can be used to position trace
messages produced by thunk. If line/col are not provided (i.e., we
just write (scope_trace thunk)), then line/col are filled with the
position of this term by the elaborator.
We can visualize the intermediate tactic states inside nested blocks
such as (try { ... })
The new infrastructure can be used to implement custom tactic_state
pretty printers.
Before this commit, if we declared an equational lemma using 'def',
then it would not be correctly added to the simp/hinst lemma set.
The new test exposes the problem.
@kha, I added autocompletion for ^. I try to elaborate the expression
before ^. using the local context provided by the parser.
The autocompletion only works if the type for the expression before ^. can be
inferred. This is a big limitation because this information cannot be
obtained in many cases. Here are examples that do not work:
meta def proof_for (e : expr) : smt_tactic expr :=
do cc ← to_cc_state, cc^.proof_for e
--^ does not work here
If we annotate cc with its type, it works:
meta def proof_for (e : expr) : smt_tactic expr :=
do cc : cc_state ← to_cc_state, cc^.proof_for e
--^ works
We don't have typing information on the equation lhs at
autocompletion time. So, the following will not work
private meta def mk_smt_goals_for (cfg : smt_config)
: list expr → list smt_goal → list expr → tactic (list smt_goal × list expr)
| [] sr tr := return (sr^.reverse, tr^.reverse)
--^ does not work since
| (tg::tgs) sr tr := ...
@kha The following three tests were broken on my machine. The new
produced output looked correct. So, I updated the expected output files.
Is this ok?
see #1296
This fixes issues with anonymous instances in sections.
In Emacs, we would get spurious error messages such as:
invalid parameter/variable declaration, '_inst_1' has already been declared
This commit also adds a regression test for the problem.
The realpath executable is not installed by default on ubuntu. Also
contains a fix for macOS where the default readlink executable does not
understand -f. The ./readlinkf.sh script does not work for directories
either.