Closed milosonator closed 7 years ago
What i normally do is minimize the problem with a binary search algorithm until i narrow down the problem to the smallest subset of rules which causes the problem.
Once i have that set of rules i create a self-contained module which exhibits the problem. That's typically quite small.
Minimal example to trigger the error, doesn't make that much sense as a semantics spec but it shows the error:
module semantics/trans/semantics
signature
sorts
Exp
constructors
Constructor: Exp
arrows
List(Exp) :: OH --> Exp :: OH
Exp --> Exp
components
OH : Map(Int,Int)
rules
Constructor() --> Constructor()
where
case true of {
true =>
otherwise =>
};
[] --> _.
Transform to DynSem Core to see the problem
'Expected result' --> remove case switch and transform to core. Semantic component is properly propagated.
Thanks. This is something i can work with.
The problem seems to be related to a (previously unknown) type analysis bug. Take the following specification:
module semantics
signature
sorts
Exp
constructors
Constructor: Exp
arrows
Exp --> Int
rules
Constructor() --> z
where
case true of {
true =>
1 => y
};
y => z.
The reference to variable y
in the last premise is incorrectly marked as unresolved. If however the reference to z
is replaced by a reference to y
then the incorrect error report no longer happens.
I believe this is a different symptom of the underlying cause of #36. Hopefully when fixing #36 this issue will just go away like a well behaved bug should.
There are static errors in my explicated DynSem core, It's very hard to make a small example to replicate the problem on a small scale.
Runtime error is:
Exception in thread "main" org.metaborg.meta.lang.dynsem.interpreter.nodes.rules.ReductionFailure: Accessed null value for slot _lifted_L_Int_O141
The problem has to do with the case switch inside the rule
ObjectL(inherit, [ ], code)
. It makes up some variables for semantic components that don't point anywhere. I thought the 'lifted_...' was something of the past.Please look into this.