Commit 6d9b65c7 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain

less debug, more strict states-to-rules translation

parent c815ad60
......@@ -98,7 +98,7 @@ revise_model([], [], [A | ACTL], Et, Ut, At) :-
revise_model([], [], [], _, _, _) :-
findall(Item, item([kind: reaction, item: Item]), Reactions),
print_message(informational, success(Reactions)).
debug(revision, 'Success!~nThe new model is: ~w', [Reactions]).
recheck_spec([], _, _) :-
......@@ -106,7 +106,7 @@ recheck_spec([], _, _) :-
recheck_spec(Specs, Init, Bool) :-
join_op('/\\', Specs, Spec),
print_message(informational, checking(Spec)),
debug(revision, 'Checking consolidated query ~w', [Spec]),
check_ctl_impl(Spec, Init, no, Bool, true).
......@@ -267,11 +267,11 @@ find_rule(R) :-
add_reaction_backtracking(R) :-
(
add_item([kind: reaction, item: R]),
print_message(informational, added(R))
debug(revision, 'Adding reaction ~w', [R])
;
delete_item([kind: reaction, item: R]),
print_message(informational, failure),
print_message(informational, removed(R)),
debug(revision, 'Removing reaction ~w', [R]),
fail
).
......@@ -326,11 +326,11 @@ delete_rules :-
del_reaction_backtracking(R) :-
(
delete_item([kind: reaction, item: R]),
print_message(informational, removed(R))
debug(revision, 'Removing reaction ~w', [R])
;
add_item([kind: reaction, item: R]),
print_message(informational, failure),
print_message(informational, added(R)),
debug(revision, 'Adding reaction ~w', [R]),
fail
).
......@@ -342,6 +342,8 @@ compatible(SInc, SDec, SPres, Reaction) :-
% products are true at the end
ord_union(SInc, SPres, SAfter),
ord_subset(UProd, SAfter),
% only products can increase
ord_subset(SInc, UProd),
% only reactants can decrease
ord_subset(SDec, UReac),
% all reactants and catalyst had to be present
......@@ -368,20 +370,8 @@ remove_stoich(_*X, X).
prolog:message(step(Step)) -->
['Entering step ~w'-[Step]].
prolog:message(added(Reaction)) -->
['Adding reaction ~w'-[Reaction]].
prolog:message(removed(Reaction)) -->
['Removing reaction ~w'-[Reaction]].
prolog:message(trying(Reaction)) -->
['Considering reaction ~w'-[Reaction]].
prolog:message(checking(Query)) -->
['Checking consolidated query ~w'-[Query]].
prolog:message(success(Reactions)) -->
['Success!', nl, 'The new model is: ~w'-[Reactions]].
['Considering adding reaction ~w'-[Reaction]].
prolog:message(failure) -->
['Failed'].
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