diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2024-01-31 15:37:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 15:37:59 +0100 |
commit | 5c49bb45c7955490319f229ffbe72cfdf3102b22 (patch) | |
tree | 6733bc25edf7c373da2e1338cb057ddb206a91bf /bin | |
parent | 97fb9565eef826cbb52117412b6eb8a242bfb0ad (diff) | |
download | spack-5c49bb45c7955490319f229ffbe72cfdf3102b22.tar.gz spack-5c49bb45c7955490319f229ffbe72cfdf3102b22.tar.bz2 spack-5c49bb45c7955490319f229ffbe72cfdf3102b22.tar.xz spack-5c49bb45c7955490319f229ffbe72cfdf3102b22.zip |
ASP-based solver: decouple setup phase from `clingo.backend` (#41952)
Currently, the `SpackSolverSetup` and the `PyclingoDriver` are more coupled than necessary:
1. The driver object needs a setup object to be injected during a solve,
2. And the setup object will get a reference back to the driver
This design is necessary because we use the low-level `clingo.backend` interface to setup our problem. This interface though is meant to bypass the grounder and add symbols directly in the grounded table, which is a feature we don't currently use.
The PR simplifies the encoding by having the setup object returning the problem-specific facts / rules as a list of strings, and the driver ingesting them using the [clingo.Control.add](https://potassco.org/clingo/python-api/5.6/clingo/control.html#clingo.control.Control.add) method. This removes any use of the low level interface.
Using this encoding makes it easy to hash the output of the setup phase, since it is returned as a string.
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions