Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
biocham
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Lifeware
biocham
Commits
f1f10a97
Commit
f1f10a97
authored
Jul 06, 2016
by
SOLIMAN Sylvain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added the big example from Miguel, lead to a few bugfixes
parent
a4e26a9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
8 deletions
+44
-8
revision.pl
revision.pl
+14
-7
revision.plt
revision.plt
+30
-1
No files found.
revision.pl
View file @
f1f10a97
...
...
@@ -70,17 +70,19 @@ revise_model([], [], [A | ACTL], Et, Ut, At) :-
(
Result
=
true
->
print_message
(
informational
,
step
(
'A'
))
print_message
(
informational
,
step
(
'A'
)),
revise_model
([],
[],
ACTL
,
Et
,
Ut
,
[
A
|
At
])
;
print_message
(
informational
,
step
(
'A'''
)),
list_reactions
,
find_and_delete_rules
,
% FIXME check At too since self-loops can be added by removing a reaction
append
(
[
A
|
Ut
]
,
Et
,
AllSpec
),
append
(
Ut
,
Et
,
AllSpec
),
% FIXME the published algorithm actually allows to not re-check, but
% simply split and add again to the formulae to be verified
recheck_spec
(
AllSpec
,
Init
,
Bool
)
),
revise_model
([],
[],
ACTL
,
Et
,
Ut
,
[
A
|
At
]
).
recheck_spec
(
AllSpec
,
Init
,
Bool
)
,
revise_model
([],
[],
[
A
|
ACTL
],
Et
,
Ut
,
At
)
).
revise_model
([],
[],
[],
_
,
_
,
_
)
:-
...
...
@@ -88,6 +90,9 @@ revise_model([], [], [], _, _, _) :-
print_message
(
informational
,
success
(
Reactions
)).
recheck_spec
([],
_
,
_
)
:-
!.
recheck_spec
(
Specs
,
Init
,
Bool
)
:-
join_op
(
'/\\'
,
Specs
,
Spec
),
print_message
(
informational
,
checking
(
Spec
)),
...
...
@@ -237,6 +242,7 @@ delete_rules_from_trace :-
rules_from_trace
(
States
,
Molecules
,
Rules
),
% We cut a single state-transition, if necessary by removing several rules
member
(
ToBeDeleted
,
Rules
),
ToBeDeleted
\
=
[],
maplist
(
del_reaction_backtracking
,
ToBeDeleted
).
...
...
@@ -293,8 +299,9 @@ compatible(SInc, SDec, SPres, Reaction) :-
item
([
kind
:
reaction
,
item
:
Reaction
]),
reaction
(
Reaction
,
_
,
Reactants
,
Products
,
false
),
remove_stoichiometry_and_sort
(
Reactants
,
Products
,
UReac
,
UProd
,
UCata
),
% true products are precisely what increases
SInc
=
UProd
,
% products are true at the end
ord_union
(
SInc
,
SPres
,
SAfter
),
ord_subset
(
UProd
,
SAfter
),
% only reactants can decrease
ord_subset
(
SDec
,
UReac
),
% all reactants and catalyst had to be present
...
...
revision.plt
View file @
f1f10a97
...
...
@@ -61,7 +61,8 @@ test(
'revise_model rule deletion (from counter-example) for ACTL',
[
setup(clear_model),
all(Reactions = [[], [b => c]])
% all(Reactions = [[], [b => c]])
all(Reactions = [[b => c]])
]
) :-
command(present(a)),
...
...
@@ -72,4 +73,32 @@ test(
findall(Item, item([kind: reaction, item: Item]), Reactions).
test(
'revise_model rule deletion for ACTL, Miguel bigger example',
[
setup(clear_model),
all(Reactions =
[['_'=>b,'_'=>a+b,'_'=[a]=>b,'_'=[b]=>'_','_'=[b]=>a,'_'=[a+b]=>'_']])
]
) :-
command(add_reaction('_' => '_')),
command(add_reaction('_' => a)),
command(add_reaction('_' => b)),
command(add_reaction('_' => a+b)),
command(add_reaction(a => '_')),
command(add_reaction(a => a)),
command(add_reaction(a => b)),
command(add_reaction(a => a+b)),
command(add_reaction(b => '_')),
command(add_reaction(b => a)),
command(add_reaction(b => b)),
command(add_reaction(b => a+b)),
command(add_reaction(a+b => '_')),
command(add_reaction(a+b => a)),
command(add_reaction(a+b => b)),
command(add_reaction(a+b => a+b)),
revise_model(not(a) \/ 'AX'(a /\ b)),
findall(Item, item([kind: reaction, item: Item]), Reactions).
:- end_tests(revision).
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment