Commit a43e1b87 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain
Browse files

All 37 tests passed?!?

parent c2706449
......@@ -476,7 +476,7 @@ test_rate_independence_invariants :-
test_rate_independence_invariants(Output, Id) :-
debug(rate, "Trying for output ~w", [Output]),
(
is_covered_by_p_invariant_with_single_surinv(Output, Output)
is_covered_by_p_invariant_with_single_surinv(Output, Output, _)
->
debug(rate, "~w is the single output of a P-invariant", [Output])
;
......@@ -484,10 +484,11 @@ test_rate_independence_invariants(Output, Id) :-
fail
),
retractall(seen(_)),
retractall(visiting(_)),
iterate_on_parents(Output, Id).
is_covered_by_p_invariant_with_single_surinv(Species, Output) :-
is_covered_by_p_invariant_with_single_surinv(Species, Output, P) :-
p_invariant(P),
member(Species, P),
output(Output),
......@@ -495,8 +496,7 @@ is_covered_by_p_invariant_with_single_surinv(Species, Output) :-
sur_invariant(S),
S \= [Output],
ord_subset(S, P)
),
!.
).
is_covered_by_sur_invariant(Species) :-
......@@ -522,10 +522,13 @@ iterate_on_parents(Species, GraphId) :-
),
(
debug(rate, "parent reaction: ~w", [Reaction]),
retractall(visiting(Species-_)),
assertz(visiting(Species-[])),
forall(
item([parent: GraphId, kind: edge, item: (Reactant -> Reaction)]),
(
debug(rate, "parent: ~w", [Reactant]),
visiting(Species-ParentPinvs),
(
seen(Reactant)
->
......@@ -535,8 +538,11 @@ iterate_on_parents(Species, GraphId) :-
->
debug(rate, "parent ~w non-decreasing", [Reactant])
;
is_covered_by_p_invariant_with_single_surinv(Reactant, _)
is_covered_by_p_invariant_with_single_surinv(Reactant, _, P),
\+ member(P, ParentPinvs)
->
retract(visiting(Species-ParentPinvs)),
assertz(visiting(Species-[P | ParentPinvs])),
debug(rate, "parent ~w in P-invariant, iterating", [Reactant]),
iterate_on_parents(Reactant, GraphId)
;
......
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