% Test rate independence for given inputs and outputs by performing rate-independence preserving reduction
test_rate_independence(Inputs,Outputs):-
biocham_command,
type(Inputs,{object}),
type(Outputs,{object}),
doc('Test graphical sufficient conditions for rate independence of the current model (assuming well-formed kinetics)
for the computation of molecular species in \\argument{Outputs} from species in \\argument{Inputs}.
Warning: this command destroys the current model by applying the \\command{rate_independence_reduction}.'),
rate_independence_reduction(Inputs,Outputs),
test_rate_independence.
test_rate_independence_inputs_sinks:-
biocham_command,
doc('Test graphical sufficient conditions for rate independence of the current model for the computation of graph output species from graph input species (assuming well-formed kinetics). The input species are the species that are not a reaction product or a strict catalyst (i.e. with same stoichiometry). The output species are the species that are not reactant.'),
input_species(Inputs),
sink_species(Outputs),
test_rate_independence(Inputs,Outputs).
% Performs a model reduction which preserves the rate independence property for given inputs and outputs
rate_independence_reduction(Inputs,Outputs):-
biocham_command,
type(Inputs,{object}),
type(Outputs,{object}),
doc('Reduces the current reaction model while preserving rate independence for computing \\argument{Outputs} species from \\argument{Inputs} species.'),
write('inputs: '),writeln(Inputs),
write('outputs: '),writeln(Outputs),
simplify(Inputs,Outputs),
!.
rate_independence_reduction_inputs_sinks:-
biocham_command,
doc('Reduces the current reaction model while preserving the rate independence property for computing the graph sink species from the input species. Warning: the reduction does not preserve the computation, only the rate independence property which may be true or false.'),