This file defines the ADT for representing symbolic tags.
We currently represent with two total unary functions:
keys : E -> Set Stringmaps each instance of the entity typeEto a set of strings. This set represents all tags that are attached to the given instance ofE.vals : {"entity" : E, "tag" : String} -> Tmaps pairs of E and String to a tag value of typeT. This is equivalent to using a binary function of typeE -> String -> Tto represent tag values, but we don't need to introduce binary functions into the Term language. It may be necessary to do so in the future if it turns out that wrapping the entity and string arguments into a value doesn't perform well enough.
With this representation, testing if an entity e has the tag s amounts to checking
if s is a member of keys e. Safely getting the value of the tag s for the entity
e amounts to returning none if s is not a member of es keys set, and otherwise
returnng vals e s.
Equations
- τs.hasTag entity tag = Cedar.SymCC.Factory.set.member tag (Cedar.SymCC.Factory.app τs.keys entity)
Instances For
Equations
- τs.getTag! entity tag = Cedar.SymCC.Factory.app τs.vals (Cedar.SymCC.Factory.tagOf entity tag)
Instances For
Equations
- τs.getTag entity tag = Cedar.SymCC.Factory.ifTrue (τs.hasTag entity tag) (τs.getTag! entity tag)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Cedar.SymCC.instReprSymTags = { reprPrec := Cedar.SymCC.instReprSymTags.repr }