Skip to content
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

Rules order in the subtyping algorithm. #46

Open
dannywillems opened this issue Apr 20, 2017 · 0 comments
Open

Rules order in the subtyping algorithm. #46

dannywillems opened this issue Apr 20, 2017 · 0 comments

Comments

@dannywillems
Copy link
Owner

dannywillems commented Apr 20, 2017

Subtyping algorithm uses an OCaml pattern-matching for each cases.
The problem with the pattern matching it's when a pattern is detected, it enters in the expression for this pattern and won't try all other possibilities. But, maybe it's not the rule to apply, it could exist other rules for the question.

For the moment, if two cases are possible, depending on the order in the pattern matching, the second case is not used to try to infer the answer.

Cases like AND1 <: and AND2 <: are good examples because the answer to the question like S <: T INTER U can be infered by AND1<: or by AND2<: and it's not because one fails that the other will fail. For this reason, the rules are grouped in only one pattern.

The same thing happens with SEL <: and <: SEL when we have x.t <: y.t.

A work must be done to know when two rules can be applied for the same question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant