-
Notifications
You must be signed in to change notification settings - Fork 16
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
Simplify equalities using their domains #461
Comments
(@ozgurakgun in #456) |
You might want to divorce the alldif one from this plan to make it a bit more manageable. Also remember SR's simplifications for all diff, there is more you can do like pigeonhole analysis: count the number of values and variables you have in the alldiff etc. The rest sounds good to me! |
Having a way to invalidate fields in metadata might affect your current rewriter engine work? Not sure what you have already, but for example you could call an empty method called |
I may be misunderstanding but this seems to only hold when the domains additionally contain just one element? A and B having the same domains doesn't mean they are always equal! What would make more sense: The second one makes sense to me; you could also write an |
Oops! Checked Savile Row, and it should be I've edited the issue |
Description
Implement simplifier rules for
=
and!=
based on the domains of their arguments:a = b ~> false
ifdomain(a) ∩ domain(b) = {}
(the domains of a and b are completely different)a != b ~> true
ifdomain(a) ∩ domain(b) = {}
Do the!=
case pairwise for anallDiff
.For example, for test
mod_undefzero-04-nested-neq
, Savile Row does:To do this well, we need the notion of a category, and to cache an expressions category, domain, and type inside its
Metadata
.Features
Expression::category_of
.Metadata
.a=b
anda!=b
based on the domains of the arguments.Implement analldiff
simplifier based on the domains of the arguments.rules::utils
to use categories where possible.CC: @ozgurakgun
The text was updated successfully, but these errors were encountered: