summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2020-12-22 10:49:36 -0800
committerGitHub <noreply@github.com>2020-12-22 19:49:36 +0100
commit5f2a821183609234351223645bd15e23ec80435d (patch)
treedf916e9f5228261bfd4cdd8e119a009c52777f3c /bin
parent97aa455f146c84a30551e6f7a36552caf3b66d07 (diff)
downloadspack-5f2a821183609234351223645bd15e23ec80435d.tar.gz
spack-5f2a821183609234351223645bd15e23ec80435d.tar.bz2
spack-5f2a821183609234351223645bd15e23ec80435d.tar.xz
spack-5f2a821183609234351223645bd15e23ec80435d.zip
concretizer: refactor conditional rules to be less repetitious (#20507)
We have to repeat all the spec attributes in a number of places in `concretize.lp`, and Spack has a fair number of spec attributes. If we instead add some rules up front that establish equivalencies like this: ``` node(Package) :- attr("node", Package). attr("node", Package) :- node(Package). version(Package, Version) :- attr("version", Package, Version). attr("version", Package, Version) :- version(Package, Version). ``` We can rewrite most of the repetitive conditions with `attr` and repeat only for each arity (there are only 3 arities for spec attributes so far) as opposed to each spec attribute. This makes the logic easier to read and the rules easier to follow. Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions