concretizer: don't generate rules for empty version lists
If the version list passed to one_of_iff is empty, it still generates a rule like this: node_compiler_version_satisfies("fujitsu-mpi", "arm", ":") :- 1 { } 1. 1 { } 1 :- node_compiler_version_satisfies("fujitsu-mpi", "arm", ":"). The cardinality rules on the right and left above are never satisfiale, and these rules do nothing. - [x] Skip generating any rules at all for empty version lists.
This commit is contained in:
parent
2231dfc898
commit
0620d954f5
1 changed files with 4 additions and 0 deletions
|
@ -573,6 +573,10 @@ def iff(self, expr1, expr2):
|
|||
self.rule(head=expr2, body=expr1)
|
||||
|
||||
def one_of_iff(self, head, versions):
|
||||
# if there are no versions, skip this one_of_iff
|
||||
if not versions:
|
||||
return
|
||||
|
||||
self.out.write("%s :- %s.\n" % (head, AspOneOf(*versions)))
|
||||
self.out.write("%s :- %s.\n" % (AspOneOf(*versions), head))
|
||||
|
||||
|
|
Loading…
Reference in a new issue