Closed WileyCorning closed 2 years ago
I believe this has the same root cause as https://github.com/SemGuS-git/Semgus-Parser/issues/68.
The parser currently recognizes two forms: [1] <predicate>
or [2] (and <sem-rel>... <predicate>)
.
For your first example, (and (> 0 x) (= r 0))
, the parser is throwing an error because it looks like [2], but only one predicate is allowed in [2], but (> 0 x)
and (= r 0)
are present.
Workaround: specify all complex semantics like: (and <sem-rel>... (and <pred>...))
, where there may be zero semantic relations. In your example, this would be: (and (and (> 0 x) (= r 0)))
Not sure about the second one. Is it really the same error message? That doesn't make sense to me.
Only variables are allowed to be arguments to semantic relations currently. I think this was an initial convenience for implementation - not sure if there was a deeper reason, but it does need to be extended to literals (at least).
Workaround: introduce another variable for the constant:
(exists ((mu Int) (zero Int))
(and (E.Sem t1 zero zero mu)
(and (= zero 0)
(= r mu))))
The following trivial example:
throws this error during parsing:
It appears that the parser expects a certain child-term configuration to be present if the CHC contains an
and
.Also, oddly, this file parses:
but this one doesn't, throwing the same error as above:
which suggests some difference in handling between child semantic relation queries with variable arguments vs. with literal / expression arguments.