# Encoding company-controls_decision.gringo

Name company-controls_decision.gringo [Root]    Unclassified (114)    Company Controls (3) Martin Gebser Martin Gebser and Roland Kaminski A Gringo encoding of Company Controls. (No search needed) 2009-03-13 06:16 2009-05-10 18:17 Decision Version of Company Controls checkForMaxControls/1company/1owns/3 controls/2 No ASP Contest 09 (Martin Gebser)No Search (Martin Gebser) #hide. #show controls(X,Y). pcontrollable(Y) :- company(Y), 51 [ owns(X,Y,N) : owns(X,Y,N) = N ]. pcontroller(X) :- owns(X,Y,M), 51 [ owns(X,Y,N) : owns(X,Y,N) = N ]. reach(X,Y) :- pcontrollable(X;Y), owns(X,Y,N), N > 0. reach(X,Y) :- pcontroller(X), pcontrollable(Y), owns(X,Y,N), N > 0. reach(X,Z) :- pcontroller(X), pcontrollable(Y;Z), owns(X,Y,N), N > 0, reach(Y,Z). % controlls(X,X) :- pcontroller(X), company(X). controls(X,Z) :- pcontroller(X), reach(X,Z), 51 [ owns(X,Z,O) : owns(X,Z,O) = O, controls(X,Y) : X != Y : owns(Y,Z,N) = N ]. % controls(X,Y) :- controlls(X,Y), X != Y. :- checkForMaxControls(X), pcontroller(Y), X != Y, not 0 [ controls(X,U) : reach(X,U) = 1, controls(Y,V) : reach(Y,V) = -1 ]. :- checkForMaxControls(X), not pcontroller(X), pcontroller(Y).