Skip to content

Commit dc828ae

Browse files
committed
more type forwarding
1 parent b997386 commit dc828ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/abstractalgebra.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,16 @@ let
5959
@rule(zero(~x) => 0)
6060
@rule(one(~x) => 1)]
6161

62+
simterm(x, f, args;metadata=nothing) = similarterm(x,f,args, symtype(x); metadata=metadata)
6263
mpoly_rules = [@rule(~x::ismpoly - ~y::ismpoly => ~x + -1 * (~y))
6364
@rule(-(~x) => -1 * ~x)
6465
@acrule(~x::ismpoly + ~y::ismpoly => ~x + ~y)
6566
@rule(+(~x) => ~x)
6667
@acrule(~x::ismpoly * ~y::ismpoly => ~x * ~y)
6768
@rule(*(~x) => ~x)
6869
@rule((~x::ismpoly)^(~a::isnonnegint) => (~x)^(~a))]
69-
global const MPOLY_CLEANUP = Fixpoint(Postwalk(PassThrough(RestartedChain(mpoly_preprocess))))
70-
MPOLY_MAKER = Fixpoint(Postwalk(PassThrough(RestartedChain(mpoly_rules))))
70+
global const MPOLY_CLEANUP = Fixpoint(Postwalk(PassThrough(RestartedChain(mpoly_preprocess)), similarterm=simterm))
71+
MPOLY_MAKER = Fixpoint(Postwalk(PassThrough(RestartedChain(mpoly_rules)), similarterm=simterm))
7172

7273
global to_mpoly
7374
function to_mpoly(t, dicts=_dicts())

0 commit comments

Comments
 (0)