diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2020-12-22 10:49:36 -0800 |
---|---|---|
committer | Tamara Dahlgren <dahlgren1@llnl.gov> | 2021-02-17 17:07:32 -0800 |
commit | 1a1babe185fd9a01a518a5c25a55896e70909a89 (patch) | |
tree | d43405e3b6d07cdd11746e48a9d5335fe75da958 /.github | |
parent | acd523c7f39002cc5bcc7c28c5587fcce3e779f7 (diff) | |
download | spack-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 '.github')
0 files changed, 0 insertions, 0 deletions