Ralf Hemmecke wrote:
> 
> I just stumpled upon LazyStreamAggregate. There we have
> 
> LazyStreamAggregate(S:Type): Category == StreamAggregate(S) with
>      ...
>   add
>      ...
> --% STAGG functions
> 
>    possiblyInfinite? x ==
>      y := x
>      for i in 0.. repeat
>        explicitlyEmpty? y  => return false
>        lazy? y => return true
>        if odd? i then x := rst x
>        y := rst y
>        eq?(x,y) => return true
> 
>    explicitlyFinite? x == not possiblyInfinite? x
> 
> whereas
> 
> StreamAggregate(S:Type): Category ==
>     Join(UnaryRecursiveAggregate S, LinearAggregate S) with
>        explicitlyFinite?: % -> Boolean
>          ++ explicitlyFinite?(s) tests if the stream has a finite
>          ++ number of elements, and false otherwise.
>          ++ Note: for many datatypes, \axiom{explicitlyFinite?(s) = not 
> possiblyInfinite?(s)}.
>        possiblyInfinite?: % -> Boolean
>          ++ possiblyInfinite?(s) tests if the stream s could possibly
>          ++ have an infinite number of elements.
>          ++ Note: for many datatypes, \axiom{possiblyInfinite?(s) = not 
> explictlyFinite?(s)}.
>   add
>     explicitlyFinite? x == not cyclic? x
>     possiblyInfinite? x == cyclic? x
>     ...
> 
> Where is it defined how this multiple inheritance is resolved. As far as 
> I remember, Aldor leaves that undefined, which basically means, one 
> shouldn't use such constructions.

Not excalty, undefind sometimes is used as synonym for "anything can
happen (including killing your cat)".  AFAIK Aldor promises that
one of defaults will be run.  Practically, this means that each
defualt should work for all domains to which it applies.

> What is the rule for SPAD and where is that written down. Currently I 
> cannot interpret the code without relying on a specific implementation 
> of the SPAD compiler. :-(
 
I think the followong rule would be reasonable: if A is direct or
indirect child of B and both A and B provide defalt for 'f', then
'f' from B will not be used.  However, I did not check if this
rule is implemented...

-- 
                              Waldek Hebisch
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to