Extends Lean's incremental reporting and reuse between commands into various steps inside declarations: * headers and bodies of each (mutual) definition/theorem * `theorem ... := by` for each contained tactic step, including recursively inside supported combinators currently consisting of * `·` (cdot), `case`, `next` * `induction`, `cases` * macros such as `next` unfolding to the above  *Incremental reuse* means not recomputing any such steps if they are not affected by a document change. *Incremental reporting* includes the parts seen in the recording above: the progress bar and messages. Other language server features such as hover etc. are *not yet* supported incrementally, i.e. they are shown only when the declaration has been fully processed as before. --------- Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
31 lines
1.1 KiB
Text
31 lines
1.1 KiB
Text
/-! Incremental reuse in `mutual` -/
|
|
|
|
/-! should invalidate body of `b1` only -/
|
|
|
|
mutual
|
|
def b0 : (by dbg_trace "b 0 0"; exact Nat) := (by dbg_trace "b 0 1"; exact 0)
|
|
|
|
def b1 : (by dbg_trace "b 1 0"; exact Nat) := (by dbg_trace "b 1 1"; exact 0)
|
|
--^ sync
|
|
--^ insert: ".5"
|
|
end
|
|
|
|
/-! should invalidate both bodies (and, in current impl, second header) -/
|
|
|
|
-- RESET
|
|
mutual
|
|
def f0 : (by dbg_trace "f 0 0"; exact Nat) := (by dbg_trace "f 0 1"; exact 0)
|
|
--^ sync
|
|
--^ insert: ".5"
|
|
def f1 : (by dbg_trace "f 1 0"; exact Nat) := (by dbg_trace "f 1 1"; exact 0)
|
|
end
|
|
|
|
/-! should invalidate everything but header of `h0` -/
|
|
|
|
-- RESET
|
|
mutual
|
|
def h0 : (by dbg_trace "h 0 0"; exact Nat) := (by dbg_trace "h 0 1"; exact 0)
|
|
def h1 : (by dbg_trace "h 1 0"; exact Nat) := (by dbg_trace "h 1 1"; exact 0)
|
|
--^ sync
|
|
--^ insert: ".5"
|
|
end
|