Commit e4eca250 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

support for logical operators

Closes #133
parent c97c1fb7
...@@ -71,6 +71,8 @@ function parse_math(ast::VPtr)::Math ...@@ -71,6 +71,8 @@ function parse_math(ast::VPtr)::Math
relational_oper(Int(ccall(sbml(:ASTNode_getType), Cint, (VPtr,), ast))), relational_oper(Int(ccall(sbml(:ASTNode_getType), Cint, (VPtr,), ast))),
parse_math_children(ast), parse_math_children(ast),
) )
elseif ast_is(ast, :ASTNode_isLogical)
return MathApply(get_string(ast, :ASTNode_getName), parse_math_children(ast))
elseif ast_is(ast, :ASTNode_isLambda) elseif ast_is(ast, :ASTNode_isLambda)
children = parse_math_children(ast) children = parse_math_children(ast)
if !isempty(children) if !isempty(children)
......
...@@ -16,6 +16,7 @@ const default_symbolics_mapping = Dict{String,Any}( ...@@ -16,6 +16,7 @@ const default_symbolics_mapping = Dict{String,Any}(
"-" => :-, "-" => :-,
"/" => :/, "/" => :/,
"abs" => :abs, "abs" => :abs,
"and" => :&,
"arccos" => :acos, "arccos" => :acos,
"arccosh" => :acosh, "arccosh" => :acosh,
"arccot" => :acot, "arccot" => :acot,
...@@ -46,6 +47,8 @@ const default_symbolics_mapping = Dict{String,Any}( ...@@ -46,6 +47,8 @@ const default_symbolics_mapping = Dict{String,Any}(
"log" => :sbmlLog, "log" => :sbmlLog,
"lt" => :<, "lt" => :<,
"neq" => :(sbmlNeq), "neq" => :(sbmlNeq),
"not" => :not,
"or" => :|,
"piecewise" => :(sbmlPiecewise), "piecewise" => :(sbmlPiecewise),
"power" => :^, "power" => :^,
"root" => :sbmlRoot, "root" => :sbmlRoot,
...@@ -55,6 +58,7 @@ const default_symbolics_mapping = Dict{String,Any}( ...@@ -55,6 +58,7 @@ const default_symbolics_mapping = Dict{String,Any}(
"sin" => :sin, "sin" => :sin,
"tanh" => :tanh, "tanh" => :tanh,
"tan" => :tan, "tan" => :tan,
"xor" => :xor,
) )
function sbmlPiecewise(args...) function sbmlPiecewise(args...)
......
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