Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DNFs to allow bot designers to specify arbitrary logical formulas for preconditions, "when" conditions, and context dependent system actions #4

Open
beckydvn opened this issue Aug 24, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@beckydvn
Copy link
Member

beckydvn commented Aug 24, 2022

Implementation has started here (see this function): https://github.com/QuMuLab/plan4dial/blob/ee7654440b3e2a6632e1b215d2ecb96a93c09700/plan4dial/parsing/json_config_parser.py#L90

This function converts an and/or nesting from the YAML into a logical formula, and converts it to DNF.

The issue is that the naive implementation for converting to CNF (without using auxiliary variables) has yet to be implemented: QuMuLab/python-nnf#21

Once it is, you should be able to use the results returned from this function to generate actions that carry out the equivalent condition. This is based on the idea that having an action with the precondition "a or b" is equivalent to having two adjacent actions with the same effects, one with the precondition a, the other with the precondition b. We avoid using "or" conditions directly because of the tendency to create axioms.

Note that currently, the user is able to specify "or"s in the precondition, as well as "or"s of "and's" by listing multiple conditions under an "or" bullet (see https://github.com/QuMuLab/plan4dial/blob/ee208d2849a40a68ac9d358e03ea6c4988b7cd3e/plan4dial/yaml_samples/or_test.yml#L75) and the equivalent actions will be generated (see https://github.com/QuMuLab/plan4dial/blob/ee7654440b3e2a6632e1b215d2ecb96a93c09700/output_files/or_test/or_test_domain.pddl#L56). Further nestings like "and"s of "or"s are not currently allowed, which is what this issue hopes to solve.

Ideally we can also apply this to "when" conditions, although "when" conditions may end up being converted to regular actions, in which case no extra work would need to be done (see #3 ).

Finally, it should also be applied to "context" specifications for context dependent system action, replacing the current context setting with the possibility for more complex formulas.

@beckydvn beckydvn added the enhancement New feature or request label Aug 24, 2022
@beckydvn beckydvn changed the title Use DNF's to allow bot designers to specify arbitrary logical formulas for preconditions and "when" conditions Use DNF's to allow bot designers to specify arbitrary logical formulas for preconditions, "when" conditions, and context dependent system actions Sep 26, 2022
@beckydvn beckydvn changed the title Use DNF's to allow bot designers to specify arbitrary logical formulas for preconditions, "when" conditions, and context dependent system actions Use DNFs to allow bot designers to specify arbitrary logical formulas for preconditions, "when" conditions, and context dependent system actions Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant