You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, all Term implementations have their own private static Interner which provides a per-class instance cache. By interning, we ensure that for all terms t1 and t2, it holds that t1.equals(t2) iff t1 == t2, i.e. we save memory by avoiding multiple equivalent instances.
Since this is a rather essential feature in order to keep Alpha's memory footprint manageable, it should be ensured that every implementation of Term follows this pattern. It would therefore make sense to have interning handled in a central place (constructor of AbstractTerm?) rather than copy the same code in every Term implementation. (Note: Maybe we could also do something "fancy" like aspect-oriented intercepts of constructor calls, etc.)
The text was updated successfully, but these errors were encountered:
Currently, all
Term
implementations have their own private staticInterner
which provides a per-class instance cache. By interning, we ensure that for all termst1
andt2
, it holds thatt1.equals(t2)
ifft1 == t2
, i.e. we save memory by avoiding multiple equivalent instances.Since this is a rather essential feature in order to keep Alpha's memory footprint manageable, it should be ensured that every implementation of
Term
follows this pattern. It would therefore make sense to have interning handled in a central place (constructor ofAbstractTerm
?) rather than copy the same code in everyTerm
implementation. (Note: Maybe we could also do something "fancy" like aspect-oriented intercepts of constructor calls, etc.)The text was updated successfully, but these errors were encountered: