Commit bbeade81 authored by Thierry Martinez's avatar Thierry Martinez

add_reaction

parent 555912a7
......@@ -51,7 +51,7 @@ test(
]
) :-
% not written 'a => b' to allow flycheck by separate compilation…
command(add_rule('=>'(a, b))),
command(add_reaction('=>'(a, b))),
command(add_conservation(a + b)),
command(check_conservations).
......@@ -66,7 +66,7 @@ test(
]
) :-
% not written 'a => b' to allow flycheck by separate compilation…
command(add_rule('=>'(a, b))),
command(add_reaction('=>'(a, b))),
command(add_conservation(a + 2*b)),
command(check_conservations).
......
......@@ -13,7 +13,6 @@
set_parameter(ParameterList) :-
biocham_command(*),
type(ParameterList, '*'(parameter = number)),
print(ParameterList), nl,
doc('sets the value of parameters.'),
\+ (
member(Parameter = Value, ParameterList),
......
:- module(
reaction_rules,
[
rule/1,
reaction/1,
basic_reaction/1,
solution/1,
......@@ -16,12 +15,6 @@
]
).
rule(_ for _).
rule(_ => _).
rule(_ <=> _).
:- grammar(reaction).
......
......@@ -131,9 +131,15 @@ command(Command) :-
check_types(Command0, ArgumentTypes, NewCommand),
NewCommand
;
rule(Command)
(
Command = (_ => _)
;
Command = (_ <=> _)
;
Command = (_ for _)
)
->
add_rule(Command)
add_reaction(Command)
;
throw(error(unknown_command(Functor/Arity)))
).
......
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