Instances For
Equations
- Lean.Widget.instToStringExprDiffTag = { toString := Lean.Widget.ExprDiffTag.toString }
A description of the differences between a pair of expressions before
, after : Expr
.
The information can be used to display a 'visual diff' for
either before
, showing the parts of the expression that are about to change,
or after
showing which parts of the expression have changed.
- changesBefore : Lean.SubExpr.PosMap Lean.Widget.ExprDiffTag✝
Map from subexpr positions in
e₀
to diff points. - changesAfter : Lean.SubExpr.PosMap Lean.Widget.ExprDiffTag✝
A map from subexpr positions in
e₁
to 'diff points' which are tags describing how the expression has changed relative tobefore
at the given position.
Instances For
Add a tag at the given position to the changesBefore
dict.
Instances For
Add a tag at the given position to the changesAfter
dict.
Instances For
Instances For
Add a tag to the diff at the positions given by before
and after
.
Instances For
If true, the expression before and the expression after are identical.
Equations
- d.isEmpty = decide (Lean.RBMap.isEmpty d.changesAfter = true ∧ Lean.RBMap.isEmpty d.changesBefore = true)
Instances For
Computes a diff between before
and after
expressions.
This works by recursively comparing function arguments.
TODO(ed): experiment with a 'greatest common subexpression' design where
given e₀
, e₁
, find the greatest common subexpressions Xs : Array Expr
and a congruence F
such that
e₀ = F[A₀[..Xs]]
and e₀ = F[A₁[..Xs]]
. Then, we can have fancy diff highlighting where common subexpressions are not highlighted.
Diffing binders #
Two binding domains are identified if they have the same user name and the same type.
The most common tactic that modifies binders is after an intros
.
To deal with this case, if before = (a : α) → β
and after
, is not a matching binder (ie: not (a : α) → _
)
then we instantiate the before
variable in a new context and continue diffing β
against after
.
Computes the diff for e₀
and e₁
. If useAfter
is false
, e₀, e₁
are interpreted as after, before
instead of before, after
.
Instances For
Given a diff
between before
and after : Expr
, and the rendered infoAfter : CodeWithInfos
for after
,
this function decorates infoAfter
with tags indicating where the expression has changed.
If useAfter == false
before and after are swapped.
Instances For
Diffs the given hypothesis bundle against the given local context.
If useAfter == true
, ctx₀
is the context before and h₁
is the bundle after.
If useAfter == false
, these are swapped.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Instances For
Decorates the given goal i₁
with a diff by comparing with goal g₀
.
If useAfter
is true then i₁
is after and g₀
is before. Otherwise they are swapped.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Modifies goalsAfter
with additional information about how it is different to goalsBefore
.
If useAfter
is true
then igs₁
is the set of interactive goals after the tactic has been applied.
Otherwise igs₁
is the set of interactive goals before.