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
Implements partial refactor to allow for Boolean & Numeric interop (via FormulaTerm wrapper) (#96)
These changes do not complete the full SMT-like refactor previously discussed, but *do* allow for interoperability between `Formula` and `Term` objects and treats the boolean sort differently so that it can be used in numeric arithmetic (as needed for standard patterns in RDDL). There are a handful hacks that were required to preserve the FSTRIPS *Effect syntax that should be fixed in the future.
The main changes include:
1. Changes the Boolean sort to be 0/1 valued and a child of the Naturals sort when the `Arithmetic` theory is included in a language (and a standalone child of `Object` otherwise)
2. Adds the `FormulaTerm` wrapper class, which is used as a container for `Formula` objects that must be treated as `Term` objects for arithmetic, etc.
3. All of `Predicate`, `Formula`, `Term`, `Function` objects are now associated with a `FirstOrderLanguage` (previously only `Function` and `Term` objects had a language property). Languages are inherited up from "subterms", when, for example, a `CompoundFormula` is constructed. This is essential for being able to construct `FormulaTerm` wrappers when needed, since `Term` objects always need an associated language.
4. Implements a set of tests (primarily focused on RDDL use cases) that adds to the existing test suite
The contributing commit messages follow:
* implements basic functionality for FormulaTerm wrapper function and makes the Boolean types a core builtin
* completes partial implementation of Term and Formula type conversion with wrappers
* implements major refactor components. includes modifications to tests to reflect API changes to FSTRIPS *Effect(s)
* fixes bug where multiple writes without reset would dump repeated obj domain lists in rddl instance
* implements basic RDDL writer integration test & makes it pass
* completes implemenation of academic_advising rddl writer integration test (passing)
* un-breaks strips *Effect building API with "`Pass` replaces `Tautology`" workaround
This is a bit of an ugly workaround, but it will work for now. we have
a special `Pass` type that is EXACTLY only ever used when we need to
construct or check against an FSTRIPS effect that is not a conditional
effect. Previously, the condition had been set as a default parameter
to `Tautology` for any regular FSTRIPS effect. However, since *Effects are
built outside of the context of a language, this did not work after we
needed a language for Tautology and Contradiction (so that other
Formula types could inherit them).
There are a few more permanent approaches to this. We could either
break the API and build Effects in the context of a language, or we
could figure out another way to have a universal Tautology that
somehow does not need to be in the context of a language. Notably this
problem will STILL BE AN ISSUE if we go to a fully boolean-valued
Function refactor (eliminating Predicates, etc), rather than the
current partial refactor that involves wrappers between Formula and
Term.
* updates tests related to Term/Formula interop and arithmetic with Booleans
* makes some code style fixes
* re-enables a test that is now passing again after pull from upstream devel
* adds option for 2018-style RDDL file format writing -- maintains default to pre-2018
* adds condition to avoid adding :numeric-fluents simply due to the Boolean sort being attached to the language
* fixes stdout name issue on macos
0 commit comments