-
Notifications
You must be signed in to change notification settings - Fork 2
Generalize IRContext.WellFormed by allowing missing uses #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In the proofs related to `insertIntoCurrent`, we need to be in a state where the IR is well formed except for some uses.
tobiasgrosser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one comment.
Veir/IR/WellFormed.lean
Outdated
| inBounds : ctx.FieldsInBounds | ||
| valueDefUseChains (valuePtr : ValuePtr) (valuePtrInBounds : valuePtr.InBounds ctx) : | ||
| ∃ array, ValuePtr.DefUse valuePtr ctx array | ||
| ∃ array, ValuePtr.DefUse valuePtr ctx array (missingOperandUses.filter (λ use => (use.get! ctx).value = valuePtr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you write ((\cdot.get! ctx).value = valuePtr) instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for me, because (\cdot.get! ctx).value = valuePtr makes the inner parenthesis a function, so .value doesn't work after that.
|
|
||
| deriving instance DecidableEq for Except | ||
|
|
||
| @[simp, grind =] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really necessary??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So https://leanprover-community.github.io/mathlib4_docs/Std/Data/ExtHashSet/Lemmas.html#Std.ExtHashSet.filter_eq_empty_iff is the nearest theorem, otherwise there is no existing theorem like this.
grind = is necessary for some proofs when I checked.
In the proofs related to
insertIntoCurrent, we need to be in a state where the IR is well formed except for some uses.