solver: add an integrity constraint for virtual nodes (#43582)

Upon close inspection of clingo answer sets, in some cases we have "equivalent" (i.e. same hash for the concrete spec) duplicates that differ only because of virtual nodes that are added to the answer set, without any edge using them.
This commit is contained in:
Massimiliano Culpo 2024-04-12 09:31:44 +02:00 committed by GitHub
parent 3b6e99381f
commit 263007ba81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -523,6 +523,12 @@ attr("virtual_on_edge", PackageNode, ProviderNode, Virtual)
provider(ProviderNode, node(_, Virtual)),
not external(PackageNode).
% If a virtual node is in the answer set, it must be either a virtual root,
% or used somewhere
:- attr("virtual_node", node(_, Virtual)),
not attr("virtual_on_incoming_edges", _, Virtual),
not attr("virtual_root", node(_, Virtual)).
attr("virtual_on_incoming_edges", ProviderNode, Virtual)
:- attr("virtual_on_edge", _, ProviderNode, Virtual).