added predicate

This commit is contained in:
gebser 2017-01-17 19:52:12 +01:00
parent 59e95c7097
commit d1f1f9230c

View File

@ -34,8 +34,7 @@ disable(A1,A2) :- active(A1), active(A2), A1 != A2, postcondition(A1,X,V),
not diverge(A1,A2), not exclude(A1,A2), not diverge(A1,A2), not exclude(A1,A2),
1 < _parallel, _parallel < 5. 1 < _parallel, _parallel < 5.
disable :- #sum{ 1,A1 : disable(A1,A2), _parallel = 4; disable :- _parallel = 4, #sum{1,A1 : disable(A1,A2); -1,A2 : disable(A1,A2)} > 0.
-1,A2 : disable(A1,A2), _parallel = 4} > 0.
scope(X,V) :- active(A), precondition(A,X,V), _parallel = 2. scope(X,V) :- active(A), precondition(A,X,V), _parallel = 2.
@ -97,15 +96,17 @@ single(X,t) :- occurs(A,t), selfdefeat(A,X).
:- single(X,t), #count{A : occurs(A,t), postcondition(A,X,V), not precondition(A,X,V)} > 1. :- single(X,t), #count{A : occurs(A,t), postcondition(A,X,V), not precondition(A,X,V)} > 1.
proceed(X,V,t) :- holds(X,V,t-1), scope(X,V). proceed(X,V,t) :- holds(X,V,t-1), scope(X,V).
proceed(X,V,t) :- occurs(A,t), postcondition(A,X,V), scope(X,V), not precondition(A,X,V), proceed(X,V,t) :- perform(A,t), scope(X,V), postcondition(A,X,V), not precondition(A,X,V),
perform(A,t). occurs(A,t).
perform(A1,t) :- active(A1), 1 < _parallel, _parallel < 4, not occurs(A1,t). perform(A,t) :- active(A), 1 < _parallel, _parallel < 4,
perform(A1,t) :- active(A1), 1 < _parallel, _parallel < 4, proceed(X,V,t) : precondition(A,X,V), _parallel = 2;
proceed(X,V,t) : precondition(A1,X,V), _parallel = 2; alright(A1,t) : disable(A,A1).
perform(A2,t) : disable(A1,A2).
:- 1 < _parallel, _parallel < 4, active(A), not perform(A,t). alright(A,t) :- active(A), 1 < _parallel, _parallel < 4, not occurs(A,t).
alright(A,t) :- perform(A,t).
:- 1 < _parallel, _parallel < 4, active(A), not alright(A,t).
#edge((A1,t),(A2,t)) : disable(A1,A2), occurs(A1,t), _parallel = 4, not disable. #edge((A1,t),(A2,t)) : disable(A1,A2), occurs(A1,t), _parallel = 4, not disable.
#edge((A1,t),(A2,t)) : disable(A1,A2), occurs(A2,t), disable. #edge((A1,t),(A2,t)) : disable(A1,A2), occurs(A2,t), disable.