Commit 0c73e3d2 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain

deleting rules, but without using the trace

parent a7a8c5f5
......@@ -194,10 +194,37 @@ add_reaction_backtracking(R) :-
find_and_delete_rules :-
listing(nusmv:trace/1),
(
nusmv:trace(_)
->
delete_rules_from_trace
;
delete_rules
).
delete_rules_from_trace :-
fail.
delete_rules :-
findall(Item, item([kind: reaction, item: Item]), Reactions),
sublist(ToBeDeleted, Reactions),
ToBeDeleted \= [],
maplist(del_reaction_backtracking, ToBeDeleted).
del_reaction_backtracking(R) :-
(
delete_item([kind: reaction, item: R]),
print_message(informational, removed(R))
;
add_item([kind: reaction, item: R]),
print_message(informational, added(R)),
fail
).
prolog:message(step(Step)) -->
['Entering step ~w'-[Step]].
......
......@@ -20,6 +20,7 @@ test(
test(
'revise_model rule addition for ECTL',
[
setup(clear_model),
all(Reactions = [['_' => b], ['_' =[a]=> b], [a => b]])
% condition(flag(slow_test, true, true)),
]
......@@ -33,6 +34,7 @@ test(
test(
'revise_model rule addition for UCTL',
[
setup(clear_model),
all(Reactions = [[a => b]])
% condition(flag(slow_test, true, true)),
]
......@@ -46,13 +48,15 @@ test(
test(
'revise_model rule deletion for ACTL',
[
all(Reactions = [[]])
setup(clear_model),
all(Reactions = [[], [b => c]])
% condition(flag(slow_test, true, true)),
]
) :-
command(present(a)),
command(absent(b)),
biocham(add_reaction(a => b)),
command(add_reaction(a => b)),
command(add_reaction(b => c)),
revise_model('AG'(a)),
findall(Item, item([kind: reaction, item: Item]), Reactions).
......
......@@ -28,7 +28,8 @@
with_clean/2,
clean/1,
check_cleaned/1,
join_op/3
join_op/3,
sublist/2
]).
name_variables(L) :-
......@@ -421,3 +422,12 @@ join_op(_Op, [Item], Item).
join_op(Op, [I1, I2 | Items], Term) :-
Term =..[Op, I1, T],
join_op(Op, [I2 | Items], T).
sublist([], []).
sublist([H | T], [H | TT]) :-
sublist(T, TT).
sublist(T, [_ | TT]) :-
sublist(T, TT).
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