First-step implementation that keeps track of types and predicates implemented
and pushed to https://bitbucket.org/malte/downward/commits/issue472.
I like the direction in which this is going: the main parsing code looks simpler
than before, and we catch errors and report them clearly where this wasn't the
case before (so far, duplicate type and predicate definitions -- later, when we
start using the symbol table in more places, also references to unknown types
and predicates).
However, this now causes an error ("duplicate type") in the storage domain,
which seems to interpret type semantics differently from us. If we handled this
domain correctly before, I assume it was more or less by accident. It should be
possible to implement a workaround, but I think it's better to first discuss
with others what the type semantics really should be. I've contacted Derek and
Maria as a first step.
Once we have a more fully developed symbol table at our disposal, I think it
would be a good idea to directly use the appropriate objects in cases where we
currently just use strings. For example, atomic facts could directly consist of
predicate and object references rather than strings that I think we currently
have. A major advantage of this would be that we don't have to look them up in
other places later and can perform all the relevant checks (does a given object
exist? what is its type?) quite easily.
|