@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 := ...
17 lines
530 B
Text
17 lines
530 B
Text
variables (α : Type) (p q : α → Prop)
|
||
|
||
example (h : ∀ x : α, p x ∧ q x) : ∀ y : α, p y :=
|
||
λ y : α, (h y)^.l
|
||
--^ "command": "complete"
|
||
|
||
example (h : ∀ x : α, p x ∧ q x) : ∀ y : α, p y :=
|
||
λ y : α, (h y)^.le
|
||
--^ "command": "complete"
|
||
|
||
example (h : ∀ x : α, p x ∧ q x) : ∀ y : α, q y :=
|
||
λ y : α, (h y)^.r
|
||
--^ "command": "complete"
|
||
|
||
example (h : ∀ x : α, p x ∧ q x) : ∀ y : α, q y :=
|
||
λ y : α, (h y)^.
|
||
--^ "command": "complete"
|