Skip to content

Commit 58863f3

Browse files
committed
Recursive simplify
1 parent 6483634 commit 58863f3

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

src/simplify.jl

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,7 @@
22
# License, v. 2.0. If a copy of the MPL was not distributed with this
33
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
44

5-
function simplify(arg::Monomial)
6-
return arg
7-
end
8-
9-
function simplify(arg::KrD)
10-
return arg
11-
end
12-
13-
function simplify(arg::Zero)
5+
function simplify(arg::Value)
146
return arg
157
end
168

@@ -19,11 +11,11 @@ function simplify(arg::UnaryOperation{Op}) where {Op}
1911
end
2012

2113
function simplify(arg::BinaryOperation{Mult})
22-
return simplify(Mult(), arg.arg1, arg.arg2)
14+
return simplify(Mult(), simplify(arg.arg1), simplify(arg.arg2))
2315
end
2416

2517
function simplify(arg::BinaryOperation{Op}) where {Op<:AdditiveOperation}
26-
return simplify(Op(), arg.arg1, arg.arg2)
18+
return simplify(Op(), simplify(arg.arg1), simplify(arg.arg2))
2719
end
2820

2921
function simplify(::Mult, arg1::Monomial, arg2::Monomial)

0 commit comments

Comments
 (0)