Commit 6b146ea7 authored by Paul Ogris's avatar Paul Ogris
Browse files

Update

parent d5ebe0af
......@@ -248,7 +248,6 @@ stmt = (StmtInstance <$> inst) <|> (StmtConst <$> cnst) <|> (StmtRule <$> rule)
_ <- dot
pure s
sig :: Parser Signature
sig = Signature <$> takeWhileP Nothing (/= '/') <*> (slash *> L.decimal)
......
#const unitCap = 2.
#const interUnitCap = 2.
{ zone2sensor(Z,S) : zone(Z), sensor(S) }.
#instance zone2sensor/2.
zone(1..10).
sensor(1..10).
unit(1..10).
1 { unit2zone(U,Z) : unit(U) } 1 :- zone(Z).
1 { unit2sensor(U,S) : sensor(U) } 1 :- sensor(S).
:- unit(U), unitCap + 1 { unit2zone(U,Z) : zone(Z) }.
:- unit(U), unitCap + 1 { unit2sensor(U,S) : sensor(S) }.
partnerunits(U,P) :- unit2zone(U,Z), zone2sensor(Z,S), unit2sensor(P,S), U != P.
partnerunits(U,P) :- partnerunits(P,U), unit(U), unit(P).
:- unit(U), interUnitCap + 1 { partnerunits(U,P) : unit(P) }.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment