Re: [fricas-devel] [PATCH] change the representation of Tree to be

2018-12-17 Thread Waldek Hebisch
oldk1331 wrote: > > On Sun, Dec 16, 2018 at 3:07 AM Waldek Hebisch > wrote: > > Well, in FriCAS tree is an aggregate. And empty aggregate > > is always legal. In fact, empty aggregate is a generic > > way to start building an aggregate. So disallowing it > > does not look right. > > For Tree

Re: [fricas-devel] [PATCH] change the representation of Tree to be

2018-12-15 Thread oldk1331
On Sun, Dec 16, 2018 at 3:07 AM Waldek Hebisch wrote: > Well, in FriCAS tree is an aggregate. And empty aggregate > is always legal. In fact, empty aggregate is a generic > way to start building an aggregate. So disallowing it > does not look right. For Tree, can I commit the patch with:

Re: [fricas-devel] [PATCH] change the representation of Tree to be

2018-12-15 Thread Waldek Hebisch
oldk1331 wrote: > > On 12/11/18 3:55 AM, Waldek Hebisch wrote: > > oldk1331 wrote: > >> > >> This patch changes the Rep of Tree from > >> Union(node:Record(value: S, args: List %),empty:"empty") > >> to > >> Record(val : S, args: List %) > >> and uses "NIL$Lisp" to represent empty tree. >

Re: [fricas-devel] [PATCH] change the representation of Tree to be

2018-12-15 Thread Waldek Hebisch
oldk1331 wrote: > > > > Sorry that I did not comment earlier: this kind of change is > > very dangerous. Namely, it can work quite nice in testing > > and then lead to error say 3 years later. The point is > > that there is correspondence between FriCAS types and > > Lisp representation. Part

Re: [fricas-devel] [PATCH] change the representation of Tree to be

2018-12-15 Thread Waldek Hebisch
Ralf Hemmecke wrote: > > > Yes, it is debatable, as we can see in > > https://en.wikipedia.org/wiki/Tree_(data_structure) > > Since you refer to wikipedia... why not using this definition: > https://en.wikipedia.org/wiki/Tree_(data_structure)#Type_theory > In orther words, we introduce forests. >

Re: [fricas-devel] [PATCH] change the representation of Tree to be more efficient

2018-12-11 Thread Ralf Hemmecke
> Yes, it is debatable, as we can see in > https://en.wikipedia.org/wiki/Tree_(data_structure) Since you refer to wikipedia... why not using this definition: https://en.wikipedia.org/wiki/Tree_(data_structure)#Type_theory In orther words, we introduce forests. Shouldn't it be possible to define F

Re: [fricas-devel] [PATCH] change the representation of Tree to be more efficient

2018-12-11 Thread oldk1331
On 12/11/18 1:55 PM, Ralf Hemmecke wrote: >> Another way to look at this "use NIL to represent empty tree" >> problem: > >> We disallow the existence of empty tree. >> >> 1. Empty tree is not required by the definition of tree. >> 2. You can not construct an empty tree from existing >> and futu

Re: [fricas-devel] [PATCH] change the representation of Tree to be more efficient

2018-12-10 Thread Ralf Hemmecke
> Another way to look at this "use NIL to represent empty tree" > problem: > We disallow the existence of empty tree. > > 1. Empty tree is not required by the definition of tree. > 2. You can not construct an empty tree from existing > and future operations of Tree: > > For example, "delete a no

Re: [fricas-devel] [PATCH] change the representation of Tree to be more efficient

2018-12-10 Thread oldk1331
> Sorry that I did not comment earlier: this kind of change is > very dangerous. Namely, it can work quite nice in testing > and then lead to error say 3 years later. The point is > that there is correspondence between FriCAS types and > Lisp representation. Part of this correspondence are > k

Re: [fricas-devel] [PATCH] change the representation of Tree to be more efficient

2018-12-10 Thread oldk1331
On 12/11/18 3:55 AM, Waldek Hebisch wrote: > oldk1331 wrote: >> >> This patch changes the Rep of Tree from >> Union(node:Record(value: S, args: List %),empty:"empty") >> to >> Record(val : S, args: List %) >> and uses "NIL$Lisp" to represent empty tree. >> >> Before this patch, >> >> (1)

Re: [fricas-devel] [PATCH] change the representation of Tree to be more efficient

2018-12-10 Thread Waldek Hebisch
oldk1331 wrote: > > This patch changes the Rep of Tree from > Union(node:Record(value: S, args: List %),empty:"empty") > to > Record(val : S, args: List %) > and uses "NIL$Lisp" to represent empty tree. > > Before this patch, > > (1) -> tree [1,2,3] pretend SEX > >(1) (0 1 (0 2) (0

[fricas-devel] [PATCH] change the representation of Tree to be more efficient

2018-12-10 Thread oldk1331
This patch changes the Rep of Tree from Union(node:Record(value: S, args: List %),empty:"empty") to Record(val : S, args: List %) and uses "NIL$Lisp" to represent empty tree. Before this patch, (1) -> tree [1,2,3] pretend SEX (1) (0 1 (0 2) (0 3)) And after: (1) -> tree [1,2,3] pre