%% A simplified Debian configuration model % Author: Tommi Syrjänen % % Usage: % lparse -d none simple_configuration_model.lp data.lp | smodels % % A package may be in a configuration only if it is justified { in(P) } :- package(P), justified(P). % It is an error if some package doesn't have its dependencies % satisfied. :- in(P1), depends(P1, P2), not in(P2). % Two conflicting packages may not be in a configuaration. :- conflicts(P1, P2), in(P1), in(P2). % The user choices must be followed. :- user_include(P), not in(P). :- user_exclude(P), in(P). % It is an error if required functionality is not present. :- user_functionality(F), not has_provider(F). has_provider(F) :- provides(P, F), in(P). % It is an error if recommendation is not followed unless the user % overrules it: :- recommends(P1, P2), in(P1), not in(P2), not user_exclude(P2). % A package is justified if the user chose it, justified(P) :- user_include(P). % the user required the functionality that it provides: justified(P) :- provides(P, F), user_functionality(F). % another package depends on it, or justified(P2) :- depends(P1, P2), in(P1). % it is recommended by some included package. justified(P2) :- recommends(P1, P2), in(P1).