@@ -84,6 +84,10 @@ function get_den(x::BasicSymbolic)
8484 x. impl. den
8585end
8686
87+ function get_base (x:: BasicSymbolic )
88+ x. impl. base
89+ end
90+
8791# Same but different error messages
8892@noinline error_on_type () = error (" Internal error: unreachable reached!" )
8993@noinline error_sym () = error (" Sym doesn't have a operation or arguments!" )
@@ -313,7 +317,7 @@ function _isequal(a, b, E)
313317 elseif E === DIV
314318 isequal (get_num (a), get_num (b)) && isequal (get_den (a), get_den (b))
315319 elseif E === POW
316- isequal (a. impl. exp, b. impl. exp) && isequal (a . impl . base, b . impl . base )
320+ isequal (a. impl. exp, b. impl. exp) && isequal (get_base (a), get_base (b) )
317321 elseif E === TERM
318322 a1 = arguments (a)
319323 a2 = arguments (b)
@@ -359,7 +363,7 @@ function Base.hash(s::BasicSymbolic, salt::UInt)::UInt
359363 elseif E === DIV
360364 return hash (get_num (s), hash (get_den (s), salt ⊻ DIV_SALT))
361365 elseif E === POW
362- hash (s. impl. exp, hash (s . impl . base , salt ⊻ POW_SALT))
366+ hash (s. impl. exp, hash (get_base (s) , salt ⊻ POW_SALT))
363367 elseif E === TERM
364368 ! iszero (salt) && return hash (hash (s, zero (UInt)), salt)
365369 h = s. hash[]
@@ -562,7 +566,7 @@ function toterm(t::BasicSymbolic{T}) where {T}
562566 elseif E === DIV
563567 _Term (T, / , [get_num (t), get_den (t)])
564568 elseif E === POW
565- _Term (T, ^ , [t . impl . base , t. impl. exp])
569+ _Term (T, ^ , [get_base (t) , t. impl. exp])
566570 else
567571 error_on_type ()
568572 end
605609function makemul (coeff, xs... ; d = Dict {BasicSymbolic, Any} ())
606610 for x in xs
607611 if ispow (x) && x. impl. exp isa Number
608- d[x . impl . base ] = x. impl. exp + get (d, x . impl . base , 0 )
612+ d[get_base (x) ] = x. impl. exp + get (d, get_base (x) , 0 )
609613 elseif x isa Number
610614 coeff *= x
611615 elseif ismul (x)
@@ -629,7 +633,7 @@ function makepow(a, b)
629633 base = a
630634 exp = b
631635 if ispow (a)
632- base = a . impl . base
636+ base = get_base (a)
633637 exp = a. impl. exp * b
634638 end
635639 base, exp
@@ -1311,7 +1315,7 @@ function *(a::SN, b::SN)
13111315 if b. impl. exp isa Number
13121316 _Mul (mul_t (a, b),
13131317 get_coeff (a),
1314- _merge (+ , get_dict (a), Base. ImmutableDict (b . impl . base => b. impl. exp),
1318+ _merge (+ , get_dict (a), Base. ImmutableDict (get_base (b) => b. impl. exp),
13151319 filter = _iszero))
13161320 else
13171321 _Mul (mul_t (a, b), get_coeff (a),
0 commit comments