Commit 1ae7c5c6 authored by FAGES Francois's avatar FAGES Francois
Browse files

reecriture correctes

parent 90d7ccd1
......@@ -165,11 +165,13 @@ dfs_no_loop(GraphId, Vertex) :-
),
assertz(seen(Vertex)).
:- dynamic(removableInputs/0).
% Elimination of trivial reactions and isolated species with no outgoing fork
simplify(_Inputs, Outputs):-
simplify(Inputs, Outputs):-
enumerate_molecules(Molecules),
subtract(Molecules, Outputs, Removable),
(removableInputs -> Mol=Molecules ; subtract(Molecules, Inputs, Mol)),
subtract(Mol, Outputs, Removable),
reduce(Removable).
reduce(Molecules):-
......@@ -216,12 +218,13 @@ same_reaction:-
write('--> removing double reaction '), writeln(Reaction2),
delete_item(Id2).
:- dynamic(noIsolatedReactant).
% Isolated reactant in one reaction
% to do? eliminates d in c+d=>e=>c+output and does not conclude to rate independence
% or not to do? does not reduce c+d=>e=>c e=>output and does not conclude to rate independence
eliminate(M):-
% fail,
\+ noIsolatedReactant,
reactions_with_product([M], []),
reactions_with_reactant([M], [Reaction1]),
reaction(Reaction1, Kinetics1, Reactants1, Inhibitors1, Products1),
......@@ -287,6 +290,9 @@ write('--> eliminating '), write(M), write(' reactant only in '), write(Reaction
% Todo: accept reversible reactions with syntax <=>
:- dynamic(noBetaEmpty).
% Elimination of M in alpha 2<=>1 M =>3 gamma rewritten to alpha=>gamma
% Elimination of M in alpha 2<=>1 beta+M =>3 gamma rewritten to alpha<=>beta =>gamma
......@@ -318,6 +324,8 @@ eliminate(M):-
delete(Reactants2, (C*M), Beta),
delete(Reactants3, (C*M), Beta),
delete(Products1, (C*M), Beta),
(noBetaEmpty -> Beta=[]; true),
write('--> eliminating '), write(M), write(' in loop '), write(Reaction1),
write(' <--> '),write(Reaction2), write(' --> '), writeln(Reaction3),
......@@ -370,7 +378,9 @@ eliminate(M):-
delete(Reactants3, (C*M), Beta),
delete(Products1, (C*M), Beta),
delete(Products4, (C*M), Beta),
(noBetaEmpty -> Beta=[]),
write('--> eliminating '), write(M), write(' in double loop '), write(Reaction1),
write(' <--> '),write(Reaction2), write(Reaction3), write(' <--> '), writeln(Reaction4),
......
prolog("writeln(' ')").
prolog('writeln("%%%%%%%% WRONG ANSWER %%%%%%%%%")').
prolog("writeln(' ')").
prolog("writeln(' ')").
prolog('writeln("%%%%%%%% UNDECIDED %%%%%%%%%")').
prolog("writeln(' ')").
......@@ -41,14 +31,6 @@ prolog('writeln("The model is rate independent: composite loop leakage with and-
prolog("writeln(' ')").
prolog("writeln(' ')").
prolog('writeln("%%%%%%% CORRECT ANSWER %%%%%%%%")').
prolog("writeln(' ')").
prolog("writeln(' ')").
clear_model.
c+d=>e.
......@@ -56,7 +38,7 @@ e=>c.
e=>f.
search_conservations.
test_rate_independence_inputs_sinks.
prolog('writeln("The model is rate independent: composite loop leakage with and-fork")').
prolog('writeln("Undecided since no: composite loop leakage with or-fork")').
......@@ -68,7 +50,8 @@ e=>c.
e=>f.
search_conservations.
test_rate_independence_inputs_sinks.
prolog('writeln("The model is rate independent: partial loop leakage with or-fork")').
prolog('writeln("Undecided since no: composite loop leakage with or-fork")').
prolog("writeln(' ')").
clear_model.
......@@ -79,7 +62,7 @@ e=>c.
e=>f.
search_conservations.
test_rate_independence_inputs_sinks.
prolog('writeln("The model is rate independent: partial loop leakage with or-fork")').
prolog('writeln("Undecided since no: composite loop leakage with or-fork")').
prolog("writeln(' ')").
......@@ -225,14 +208,6 @@ test_rate_independence_inputs_sinks.
prolog('writeln("Undecided since no: subtle multiple steady states ")').
prolog("writeln(' ')").
clear_model.
MA(k1) for a+b => b.
MA(k2) for b+c=>d.
search_conservations.
test_rate_independence_inputs_sinks. % no
prolog('writeln("The model is rate independent: output d")').
prolog("writeln(' ')").
......
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