Skip to content

Prove EvalExpressionIsDefined by adding definedness propagation to WellFormedCoreEvalCong#454

Merged
tautschnig merged 8 commits intomainfrom
tautschnig/EvalExpressionIsDefined-proof
Feb 24, 2026
Merged

Prove EvalExpressionIsDefined by adding definedness propagation to WellFormedCoreEvalCong#454
tautschnig merged 8 commits intomainfrom
tautschnig/EvalExpressionIsDefined-proof

Conversation

@tautschnig
Copy link
Copy Markdown
Contributor

Add five new fields to WellFormedCoreEvalCong (absdef, appdef, eqdef, quantdef, itedef) asserting that if a compound expression is defined, its subexpressions are also defined. This enables proving all five remaining cases (abs, quant, app, ite, eq) of EvalExpressionIsDefined by structural induction.

Kiro spent 21 minutes on this proof.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…llFormedCoreEvalCong

Add five new fields to WellFormedCoreEvalCong (absdef, appdef, eqdef,
quantdef, itedef) asserting that if a compound expression is defined,
its subexpressions are also defined. This enables proving all five
remaining cases (abs, quant, app, ite, eq) of EvalExpressionIsDefined
by structural induction.

Kiro spent 21 minutes on this proof.
Copilot AI review requested due to automatic review settings February 19, 2026 09:18
@tautschnig tautschnig requested a review from a team as a code owner February 19, 2026 09:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR strengthens the core expression evaluator well-formedness assumptions to include definedness propagation for compound expressions, enabling completion of the remaining structural-induction cases in EvalExpressionIsDefined.

Changes:

  • Extend WellFormedCoreEvalCong with five new fields (absdef, appdef, eqdef, quantdef, itedef) capturing that definedness of a compound expression implies definedness of its subexpressions.
  • Complete the previously-sorry cases (abs, quant, app, ite, eq) in EvalExpressionIsDefined using those propagation fields.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
Strata/Languages/Core/StatementSemantics.lean Adds definedness-propagation assumptions to WellFormedCoreEvalCong.
Strata/Languages/Core/StatementSemanticsProps.lean Finishes EvalExpressionIsDefined proof by structural induction using the new propagation fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Strata/Languages/Core/StatementSemantics.lean Outdated
Comment thread Strata/Languages/Core/StatementSemanticsProps.lean Outdated
Comment thread Strata/Languages/Core/StatementSemantics.lean Outdated
tautschnig and others added 2 commits February 19, 2026 10:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tautschnig tautschnig marked this pull request as draft February 19, 2026 09:47
…alCong and update field access paths

- WellFormedCoreEvalDefinedness was defined after WellFormedCoreEvalCong
  but referenced inside it, causing a forward-reference error.
  Move it before WellFormedCoreEvalCong so it is in scope.

- Update StatementSemanticsProps.lean to access definedness fields
  through the new nested path (e.g. Hwfc.definedness.absdef instead
  of Hwfc.absdef).

- Rename abscongr binders from (ty m) to (m ty) to match the .abs
  constructor argument order (m: Metadata, ty: Option TypeType),
  consistent with absdef and other fields.
@tautschnig tautschnig marked this pull request as ready for review February 19, 2026 11:17
@tautschnig tautschnig enabled auto-merge February 19, 2026 11:17
@tautschnig tautschnig assigned aqjune-aws and unassigned aqjune-aws Feb 19, 2026
Comment thread Strata/Languages/Core/StatementSemantics.lean Outdated
Comment thread Strata/Languages/Core/StatementSemanticsProps.lean Outdated
The structure bundling WellFormedCoreEvalCong and
WellFormedCoreEvalDefinedness was defined but never referenced
anywhere in the codebase. All call sites use the component
types directly.
Replace manual rcases/exact case-splitting with grind in the
quant, app, ite, and eq cases. After the definedness hypothesis
is introduced, grind handles the disjunction and hypothesis
application automatically.
@tautschnig tautschnig added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 5572293 Feb 24, 2026
15 checks passed
@tautschnig tautschnig deleted the tautschnig/EvalExpressionIsDefined-proof branch February 24, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants