-
Notifications
You must be signed in to change notification settings - Fork 8
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
Help required with getting typechecker correct again #1380
Comments
AnalysisWe made an error when we implemented the three ENFORCE statements:
The type checker requires that the type of DiagnosisThe type checker has been fixed by adding i-epsilon expressions to |
ReflectionThis error was known already half a year ago in Issue #1281. However, somebody closed that issue, so the error was never fixed. |
Strange indeed. I thought that test had been in the regression test set all the time. That was why I assumed I had broken something in doing the namespaces stuff. |
For the record: This bug is solved now in the namespace branche. If for whatever reason that branch wouldn't make it to main eventually, then we need to cherrypick the fix @sjcjoosten made and get it into main. I assume that this is theoretically only. |
It still is strange. The bug isn't there in the current main branch. Proof is here. That said, the code that @sjcjoosten has changed isn't present in the main branch. Proof is here. |
The bug surfaced because the conjuncts are calculated in the namespace branch, which causes the enforce rule to be translated into a complement with a disjunction. I don't have an explanation as to why there is a difference in which conjuncts are used and/or calculated for enforce rules between the main branch and the namespaces branch, it could be something as trivial as simply testing if there are any conjuncts through a pattern match, but the main branch does have the same bug. The way to expose it is to run:
Output is:
|
I was thinking about how to get bugs of this category to surface. The category I have in mind is that of fatals (or errors, infinite loops, etc) in the fspec structure: I'm under the assumption that there shouldn't be any. One reason this bug was hidden from view, is that Haskell calculates the fspec lazily. To avoid bugs of this category, asking whether the fspec is equal to itself should force evaluation of the entire fspec structure. That may have the downside that equality needs to be defined on structures for which we never want to calculate equality. There are also some classes in Haskell that help evaluate values into normal form, which might be an alternative way to achieve this goal. |
I think the explanation you gave makes sense. I have been working on making quite some data structures strict, using bang patterns (See this blog post. For the FSpec, that doesn't work, because it reveals an infinite loop in the normalizer, which isn't used. The bang pattern would be best to make strict. |
Smells to me, food for a separate issue though (fixing the FSpec to get rid of this so we can fully evaluate FSpec). |
I am stuck with the branch called
feature/namespaces-part1
. This feature is mainly about creating a new type forName
. That type didn't exist, all names were of typeText
. The newName
type now only takes texts that have exactly one word. Quoted names are not allowed any longer.Anyways, I have fixed all but one regressions tests. There is one that I don't know how to fix. It is related to the typechecker. See this log:
https://github.com/AmpersandTarski/Ampersand/actions/runs/3689642307/jobs/6245815393
Reproduction:
feature/namespaces-part1
.ampersand check testing/Travis/testcases/Check/EnforceTest1.adl
. It will give the following fatal:@stefjoosten and/or @sjcjoosten , could you help in any way?
The text was updated successfully, but these errors were encountered: