Add CLASSIFY base-class AS: .. ELSE: construct to declare disjoint predicate unions#2452
Open
timor wants to merge 2 commits intofactor:masterfrom
Open
Add CLASSIFY base-class AS: .. ELSE: construct to declare disjoint predicate unions#2452timor wants to merge 2 commits intofactor:masterfrom
timor wants to merge 2 commits intofactor:masterfrom
Conversation
3b66040 to
12f705b
Compare
12f705b to
2d42787
Compare
2d42787 to
b2ffc8d
Compare
Predicate classes can be declared disjoint from one-another. This is inherited, so predicate classes that specialize on a predicate class with an existing disjoint specification will inherit the set of declared-disjoint classes. Adds the `DISJOINT:` syntax word for that purpose.
b2ffc8d to
db1c73a
Compare
Contributor
Author
|
I fixed an issue with inheritance and also simplified the syntax. |
Contributor
Author
|
Also, the predicate class definitions now explicitly exclude the preceding predicate inside the |
Member
|
Can we move this to Could call it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows imposing mutually-exclusive predicate classes, which helps with dispatch on ambiguous predicate classes. The definitions are checked in order. The programmer is responsible for specifying these in the correct order, as there is no way to determine implications between predicate class membership automatically.
Example:
This is directly inspired by
Ernst, Michael, Craig Kaplan, and Craig Chambers. "Predicate dispatching: A unified theory of dispatch." European Conference on Object-Oriented Programming. Springer, Berlin, Heidelberg, 1998.
(Section 2.5)
To do that, add a
"disjoint"word property to predicate classes, which is an inheritable set of classes this predicate class is explicitly declared disjoint from. ADISJOINT: class-a class-bword is provided which can be used to declare disjoint relation between existing classes.