Giter VIP home page Giter VIP logo

Comments (7)

tedinski avatar tedinski commented on September 23, 2024

BTW: a piece of good news: so far the performance impact of being more precise about patterns has been small. happy dance

from ablec.

krame505 avatar krame505 commented on September 23, 2024

Looks the same as the issue that I had to workaround for substitution on exprStmt and a few other places - for example, in order to explicitly check if the Expr is a declRefExpr, I need to supply dummy values for env and returnType. This is actually slightly wrong, since we could be wanting to substitute on something forwarding to one of these 'target' constructs... but I can't think of a way around this without making substituted depend on env and returnType.

from ablec.

tedinski avatar tedinski commented on September 23, 2024

More progress/fixes. Current status:

Errors for edu:umn:cs:melt:ableC:abstractsyntax
 [./edu.umn.cs.melt.ableC/abstractsyntax/AttributeAnimation.sv]
AttributeAnimation.sv:5:2: warning: Equation has transitive dependency on child attr's inherited attribute for env but this equation appears to be missing.
AttributeAnimation.sv:5:2: warning: Equation has transitive dependency on child attr's inherited attribute for returnType but this equation appears to be missing.
AttributeAnimation.sv:21:2: warning: Equation has transitive dependency on child attr's inherited attribute for env but this equation appears to be missing.
AttributeAnimation.sv:21:2: warning: Equation has transitive dependency on child attr's inherited attribute for returnType but this equation appears to be missing.

Errors for edu:umn:cs:melt:ableC:abstractsyntax:substitution
 [./edu.umn.cs.melt.ableC/abstractsyntax/substitution/Attribute.sv]
Attribute.sv:60:2: warning: Synthesized equation substituted exceeds flow type with dependencies on env, returnType

from ablec.

tedinski avatar tedinski commented on September 23, 2024

I think I'm now feature-complete, and those are it for base ablec.

from ablec.

krame505 avatar krame505 commented on September 23, 2024

Those aren't the most descriptive error messages when dealing with a large match statement, but I don't know how easy that would be to improve...
Also, fixing those is going to make the code a fair bit uglier, as it already has in a few other places. It is starting to seem like a fairly common problem to be pattern matching, but needing to provide inherited attributes at some intermediate level in the pattern, which requires the match to be split up into locals.
How hard would it be to implement some sort of special pattern syntax that would allow this to be done 'in place'? For example, as in ableC where we have this problem:

case attr of
| consAttribute(gccAttribute(l) with {env = emptyEnv(); returnType = nothing();}, t) -> ...
...
end;

This could work sort of like decorate in terms of the flow analysis, except it would expect the whole forward set to be present instead of the ref set. Thoughts?

from ablec.

tedinski avatar tedinski commented on September 23, 2024

The error messages are hard to improve because tracking down what caused the dependency is slightly difficult (and can have multiple causes).

Your suggestion isn't something that works well with the pattern matching feature, but fortunately, I think you are just missing a useful detail: those children are extracted already decorated from what you're matching on. If you need to supply inherited attributes like that, all you need to do is give the dummy values to the top-level match, and they should be passed down in that tree as that tree's equations specify.

from ablec.

krame505 avatar krame505 commented on September 23, 2024

Ah, thanks for clarifying! That behavior does make sense, I'm not sure why I assumed that they are undecorated.

from ablec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.