-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add negated premises #7
base: main
Are you sure you want to change the base?
Conversation
My sense still is that it ought to be enough to only negate Boolean formulas, not inductive premises. That would seem much simpler. |
But side conditions can be arbitrary premises, including predicates. So if one has to negate them, one has to negate predicates. I don't see how you get around that. At least not without a fair number of rather arbitrary restrictions on the input (“In the rule before a rule with And at least for the proof backends, the ability to negate predicate side conditions is precisely what you need to implement |
An alternative might be to simplify premises to only allow (boolean) expressions, and add a constructor to Expressions for “call a predicate (as a boolean function)”. This would be a great fit for the Isabelle backend and arguably also for the math backend. The lean and Coq backends would have to do a bit of work to distangle |
Yes, that's the restriction I have in mind. I wouldn't call it arbitrary. We certainly do not use anything more general. |
Well, in that case let’s add |
But then wouldn't it just be redundant? The IL will be affecting almost every backend, so I'd be a bit reluctant to add something semantically complex prematurely, before we know it's really needed. |
Well, some backends need it, at least at the moment. All other backends can just error out when they encounter something they don’t want to handle – just as they can do if other invariants like “In the rule before a rule with otherwise only boolean premises can be used” are violated. I don’t see why “Some backends cannot handle non-boolean premises in negation” is so much more dubious than the existing the “Some backends cannot handle non-boolean premises in rules before a rule with |
I don’t see much wrong with the following examples, and even if we don't use it right away, wouldn’t go out of my way to not support it: Otherwise referring to rules with not syntactic different lhs:
and possibly also rules using relations in side conditions:
I’m surprised this is so contentious, so probably there is a deeper misunderstanding on my side here. Maybe @conrad-watt sees why we are talking past each other here, and can clarify? (Maybe the “issue“ is that the reduction relation is supposed to be “executable” and thus can’t use Prop-valued predicates, only bool-valued predicates, in side condition. And although it’s defined using the machinery of inductive rules, it’s really conceptually a function definition, where try-rule-in-order is much more common.) |
That's certainly part of the reason. I would also think that the meta-theory of negation in Prop is more involved than for Bool, at least in some theories. Doesn't it build in an assumption about a classical interpretation?
I don't think that's a route we should consider. The IL better be clearly defined and not up to different interpretation from different backends. The respective assumptions should be manifest in IL validation. Besides principle reasons, that's to ensure that middlend passes are (and remain) compatible with backends. I rather suggest that we explicitly rule out the use of |
No more than non-negated relation premises in an “executable” reduction relation, I'd say. |
Cross-reference relevant discussion: https://github.com/orgs/Wasm-DSL/discussions/11#discussioncomment-5976200 |
Merge with function-references
This is necessary to express the actual meaning of the
otherwise
premises.