Skip to content

Instantly share code, notes, and snippets.

@AntoineDrouhin
Last active November 21, 2018 14:48
Show Gist options
  • Save AntoineDrouhin/e25caa0c5e2ea9889448f31fb968b65b to your computer and use it in GitHub Desktop.
Save AntoineDrouhin/e25caa0c5e2ea9889448f31fb968b65b to your computer and use it in GitHub Desktop.
Paris1 Product line course / Prolog / Printer Product Line Model.
printer(L) :-
L= [
Root,
% Print functions
Print,
IncPrint,
LazerPrint,
IncBnW,
LazerBnW,
IncColor,
LazerColor,
BothSides,
BothSidesAutomatic,
BothSidesManual,
%Connection functionnalities
ConnectionDevice,
Usb,
Wireless,
Bluetooth,
Wifi
],
fd_domain(L, 0, 1),
% root_constraint
Root #= 1,
% mandatory_relationships
Root #= Print,
LazerPrint #= LazerBnW,
IncPrint #= IncBnW,
% optional_relationships
Root #>= ConnectionPC,
IncPrint #>= Print,
LazerPrint #>= Print,
Print #>= BothSides,
BothSides #>= BothSidesAutomatic,
BothSides #>= BothSidesManual,
IncPrint #>= IncColor,
LazerPrint #>= LazerColor,
% group_cardinality
% Root #>= F2,
% Root #>= F3,
% Root #>= F4,
% Root #=< F2 + F3 + F4,
% F2+ F3+ F4 #=< Root,
%mutex
IncPrint * LazerPrint #= 0,
BothSidesAutomatic * BothSidesManual #= 0,
% F3 * F8 #= 0,
% F3 * F5 #= 0,
%requires
% F7 #>= F8,
% F8 #==> F7,
% F9 #>= F5,
% F5 #==> F9,
fd_labeling(L).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment