File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1010
1111arglength (a) = length (arguments (a))
1212function < ₑ (a, b)
13- if ! istree (a) && ! istree (b)
13+ if a isa Term && (b isa Symbolic && ! (b isa Term))
14+ return false
15+ elseif b isa Term && (a isa Symbolic && ! (a isa Term))
16+ return true
17+ elseif ! istree (a) && ! istree (b)
1418 T = typeof (a)
1519 S = typeof (b)
1620 return T=== S ? (T <: Number ? isless (a, b) : hash (a) < hash (b)) : nameof (T) < nameof (S)
Original file line number Diff line number Diff line change @@ -5,15 +5,15 @@ SymbolicUtils.show_simplified[] = false
55
66@syms a b c
77
8- function istotal (x,y)
8+ function istotal (x, y)
99 # either
1010 if x < ₑ y
1111 return ! (y < ₑ x)
1212 elseif y < ₑ x
1313 return ! (x < ₑ y) # already tested
1414 else
1515 # neither, equal
16- return true
16+ return isequal (x, y)
1717 end
1818end
1919
7878@testset " small terms" begin
7979 # this failing was a cause of a nasty stackoverflow #82
8080 @syms a
81- @test Term (^ , [a, - 1 ]) < ₑ (a + 2 )
82- @test ! ((a + 2 ) < ₑ Term (^ , [a, - 1 ]))
81+ istotal (Term (^ , [a, - 1 ]), (a + 2 ))
8382end
8483
8584@testset " transitivity" begin
You can’t perform that action at this time.
0 commit comments