summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2020-12-22 10:49:36 -0800
committerTamara Dahlgren <dahlgren1@llnl.gov>2021-02-17 17:07:32 -0800
commit1a1babe185fd9a01a518a5c25a55896e70909a89 (patch)
treed43405e3b6d07cdd11746e48a9d5335fe75da958 /var
parentacd523c7f39002cc5bcc7c28c5587fcce3e779f7 (diff)
downloadspack-1a1babe185fd9a01a518a5c25a55896e70909a89.tar.gz
spack-1a1babe185fd9a01a518a5c25a55896e70909a89.tar.bz2
spack-1a1babe185fd9a01a518a5c25a55896e70909a89.tar.xz
spack-1a1babe185fd9a01a518a5c25a55896e70909a89.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 'var')
0 files changed, 0 insertions, 0 deletions