G3Kappa / Ergo

Other
4 stars 0 forks source link

Associate more strongly abstract types and their canonical forms #15

Closed G3Kappa closed 2 years ago

G3Kappa commented 2 years ago

Abstract types are working, but it's clear that they're still not a definitive improvement over the previous system.

Specifically, it seems that terms that are obtained via unification are not always converted back to their abstract form because either operand is not recognized as an abstract term. Also, terms that are written directly in canonical form have the same issue.

Extending the abstract parsers to consider canonical forms is not guaranteed to work in scenarios where unification is the culprit, although it would solve some problems.

The previous system, and to a degree the current one, made extensive use of term unfolding, i.e. manually unwrapping the AST in order to reconstruct the abstract form. This is fine if it's guaranteed to happen once per term because terms are immutable, but there's currently no cache to keep track of these things and therefore it's a very expensive operation. Still, a cache feels like a band-aid. A better solution could be lurking in the shadows.

Also, some results of unification could be represented more efficiently than they currently are: for instance, sub-lists could be represented as slices of a parent list.

G3Kappa commented 2 years ago

Considerations

Also, some results of unification could be represented more efficiently than they currently are: for instance, sub-lists could be represented as slices of a parent list.

This remains an open point.

G3Kappa commented 1 year ago

Also, some results of unification could be represented more efficiently than they currently are: for instance, sub-lists could be represented as slices of a parent list.

This remains an open point.

Good point. This should be its own issue though, past me.

G3Kappa commented 8 months ago

The cache was removed by #69 btw, which is a much cleaner solution overall