Commit 2f1067f8 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain

more revisions

parent e1161655
......@@ -93,7 +93,8 @@ revise_model([], [], [A | ACTL], Et, Ut, At) :-
).
revise_model([], [], [], _, _, _).
revise_model([], [], [], _, _, _) :-
write(success),nl.
categorize_query(Q1 /\ Q2, ECTL, UCTL, ACTL) :-
......@@ -162,14 +163,24 @@ is_ectl(Q) :-
).
% TODO use a pattern
% FIXME check that the rule is not in the model already
% TODO use a pattern instead of fixing S =[E]=> P
find_rule(R) :-
enumerate_all_molecules(Molecules),
member(M1, Molecules),
member(M2, Molecules),
M1 \= M2,
R = '=>'(M1, M2).
AllMolecules = ['_' | Molecules],
member(S, AllMolecules),
member(P, AllMolecules),
member(E, AllMolecules),
S \= P,
(
E \= '_'
->
S \= E,
P \= E,
R = '=>'(S = [E], P)
;
R = '=>'(S, P)
),
\+ item([kind: reaction, item: R]).
add_reaction_backtracking(R) :-
......@@ -179,5 +190,6 @@ add_reaction_backtracking(R) :-
write(added(R)),nl
;
delete_item([kind: reaction, item: R]),
write(removed(R)),nl
write(removed(R)),nl,
fail
).
:- use_module(library(plunit)).
% not necessary, except for separate compilation
:- use_module(reaction_rules).
:- begin_tests(revision).
......@@ -16,11 +18,16 @@ test(
).
test(
'revise_model' %, [condition(flag(slow_test, true, true))]
'revise_model',
[
all(Reactions = [[a => b]])
% condition(flag(slow_test, true, true)),
]
) :-
command(present(a)),
command(absent(b)),
revise_model('EF'(b /\ not(a))).
revise_model('EF'(b /\ not(a))),
findall(Item, item([kind: reaction, item: Item]), Reactions).
:- end_tests(revision).
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