Discussion:
[fricas-devel] [PATCH] fix 'children' in BinaryRecursiveAggregate
oldk1331
2018-11-14 10:15:50 UTC
Permalink
"children binarySearchTree [1]" should return "[]" instead of "[[]]".

diff --git a/src/algebra/aggcat.spad b/src/algebra/aggcat.spad
index f960af07..b0edbde7 100644
--- a/src/algebra/aggcat.spad
+++ b/src/algebra/aggcat.spad
@@ -1168,9 +1168,10 @@ BinaryRecursiveAggregate(S : Type) : Category ==
RecursiveAggregate S with
concat(nodes left x, concat(x, nodes right x))

children x ==
- l := empty()$List(%)
- empty? x => l
- empty? left x => [right x]
+ empty? x => empty()
+ empty? left x =>
+ empty? right x => empty()
+ [right x]
empty? right x => [left x]
[left x, right x]
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Waldek Hebisch
2018-11-14 13:40:30 UTC
Permalink
Post by oldk1331
"children binarySearchTree [1]" should return "[]" instead of "[[]]".
OK, please commit.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Loading...