diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2019-08-18 23:14:53 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2020-11-17 10:04:13 -0800 |
commit | a81258663c35774d51c53879410daca2ebe82214 (patch) | |
tree | 00a4287a0e890e866aaf7242ea4fe5d5179654f0 /lib | |
parent | 6bbc64555b13b0813a47f32179f926d9f3082f1b (diff) | |
download | spack-a81258663c35774d51c53879410daca2ebe82214.tar.gz spack-a81258663c35774d51c53879410daca2ebe82214.tar.bz2 spack-a81258663c35774d51c53879410daca2ebe82214.tar.xz spack-a81258663c35774d51c53879410daca2ebe82214.zip |
concretizer: cleanup
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/solver/concretize.lp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp index 8eca18655e..bd6a6a932a 100644 --- a/lib/spack/spack/solver/concretize.lp +++ b/lib/spack/spack/solver/concretize.lp @@ -14,21 +14,10 @@ version_possible(P, V) :- version_declared(P, V), not version_conflict(P, V). #defined version_conflict/2. -% One version, arch, etc. per package -{ arch_platform(P, A) : arch_platform(P, A) } = 1 :- node(P). -{ arch_os(P, A) : arch_os(P, A) } = 1 :- node(P). -{ arch_target(P, T) : arch_target(P, T) } = 1 :- node(P). -{ node_compiler(P, C) : node_compiler(P, C) } = 1 :- node(P). -{ node_compiler_version(P, C, V) : - node_compiler_version(P, C, V) } = 1 :- node(P). - -% one variant value for single-valued variants. -{ variant_value(P, V, X) : variant_value(P, V, X) } = 1 - :- node(P), variant(P, V), not variant_single_value(P, V). +%----------------------------------------------------------------------------- +% Dependency semantics +%----------------------------------------------------------------------------- -%============================================================================= -% Define -%============================================================================= % dependencies imply new nodes. node(D) :- node(P), depends_on(P, D). @@ -39,6 +28,10 @@ node(D) :- node(P), depends_on(P, D). % Variant semantics %----------------------------------------------------------------------------- +% one variant value for single-valued variants. +1 { variant_value(P, V, X) : variant_value(P, V, X) } 1 + :- node(P), variant(P, V), variant_single_value(P, V). + % if a variant is set to anything, it is considered 'set'. variant_set(P, V) :- variant_set(P, V, _). @@ -57,6 +50,11 @@ variant_value(P, V, X) :- node(P), variant(P, V), not variant_set(P, V), % Architecture semantics %----------------------------------------------------------------------------- +% one platform, os, target per node. +1 { arch_platform(P, A) : arch_platform(P, A) } 1 :- node(P). +1 { arch_os(P, A) : arch_os(P, A) } 1 :- node(P). +1 { arch_target(P, T) : arch_target(P, T) } 1 :- node(P). + % arch fields for pkg P are set if set to anything arch_platform_set(P) :- arch_platform_set(P, _). arch_os_set(P) :- arch_os_set(P, _). @@ -88,6 +86,11 @@ arch_target_set(D, A) :- node(D), depends_on(P, D), arch_target_set(P, A). % Compiler semantics %----------------------------------------------------------------------------- +% one compiler per node +{ node_compiler(P, C) : node_compiler(P, C) } = 1 :- node(P). +{ node_compiler_version(P, C, V) : + node_compiler_version(P, C, V) } = 1 :- node(P). + % compiler fields are set if set to anything node_compiler_set(P) :- node_compiler_set(P, _). node_compiler_version_set(P, C) :- node_compiler_version_set(P, C, _). |