diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2020-01-02 22:12:19 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2020-11-17 10:04:13 -0800 |
commit | cb8ca505ef7987fff5f4e839386d780405c47016 (patch) | |
tree | 160dfd9bfd31615625ec008de568474cb9c96b5d /lib | |
parent | 810542d4fe3d134e67d63a00b0ae4ce35bd47fb6 (diff) | |
download | spack-cb8ca505ef7987fff5f4e839386d780405c47016.tar.gz spack-cb8ca505ef7987fff5f4e839386d780405c47016.tar.bz2 spack-cb8ca505ef7987fff5f4e839386d780405c47016.tar.xz spack-cb8ca505ef7987fff5f4e839386d780405c47016.zip |
concretizer: make some rules into facts
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/solver/asp.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index eec0e01eca..cc0616f24d 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -327,23 +327,19 @@ class AspGenerator(object): # variants for name, variant in sorted(pkg.variants.items()): - self.rule(fn.variant(pkg.name, name), - fn.node(pkg.name)) + self.fact(fn.variant(pkg.name, name)) single_value = not variant.multi single = fn.variant_single_value(pkg.name, name) if single_value: - self.rule(single, fn.node(pkg.name)) - self.rule( - fn.variant_default_value(pkg.name, name, variant.default), - fn.node(pkg.name)) + self.fact(single) + self.fact( + fn.variant_default_value(pkg.name, name, variant.default)) else: self.rule(self._not(single), fn.node(pkg.name)) defaults = variant.default.split(',') for val in sorted(defaults): - self.rule( - fn.variant_default_value(pkg.name, name, val), - fn.node(pkg.name)) + self.fact(fn.variant_default_value(pkg.name, name, val)) values = variant.values if values is None: |