Conversation
|
Thanks. I will need to implement a more correct pattern matching in my meta-interpreter to account for the premises attached to the constructors. My understanding is that the front-end elaborator won't check the premises to try to infer the most precise type. In the following example, both arguments to the If that's the case, then I'm not entirely sure if |
|
Another question I have is about the right way to do substitution on the premises in Say if the actual argument passed in is A more complicated example is If I want to match |
|
Well, it's doing the "right" thing in that (a) type side conditions do not affect operational behaviour, and (b) the definition of $is_sub above violates the coherence assumption under that semantics, so can return either. But I agree that we perhaps shouldn't use something like that to distinguish rules either. I'm preparing a better fix. |
|
@zilinc, this fixes it in a much cleaner manner, please have a look. The abstract syntax now properly distinguishes ref.null instructions from ref.null_addr values, the latter not carrying a type annotation anymore, eliminating the whole problem. Unfortunately, though, this had various repercussions and required some adjustments to the AL interpreter as well as the reference interpreter. @f52985, there are |
|
Okay, I fixed the third failure, but I think there is a bug with the AL translation that causes the remaining two, because ANY.CONVERT_EXTERN looks like this in AL: I think the statements after the If ought to be in an Else branch? |
Thanks Andreas. It indeed looks to be a net simplification, and it should become totally standard in my meta-interpreter. One semi-related thing is in the bikeshed doc, https://webassembly.github.io/spec/core/bikeshed/#values%E2%91%A2 in section 4.2.1, it has the |
|
@zilinc, sigh, this appears to be another episode in the saga of Bikeshed breaking the Wasm spec. I tried a fix that seems to have worked (annoyingly, the Bikeshed build doesn't work on my Mac, so I cannot test it locally). (That said, I do not recommend the Bikeshed version of the spec. It has many issues due to missing/broken functionality in the Katex renderer it is using.) |
Sorry for the delay. The cause was somewhat subtle. The translator had a heuristic pass that treated a single case-checking condition within a block as an assertion. Previously, both conditions were case-checking conditions: Because there were two such conditions, both remained simple After this PR, however, the first condition was changed into a comparison expression involving a nullary This has now been fixed so that the translator correctly recognizes this pattern and avoids converting it into an assertion. |
Tighten the definition of ref.null refs, so that there no longer is an overlap between ref.null reduction and cast-fail rules.
@zilinc, PTAL.