axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] aldor stream oddities


From: Franz Lehner
Subject: Re: [Axiom-developer] aldor stream oddities
Date: Sat, 11 Aug 2007 20:55:38 +0200 (CEST)


Now, in Axiom we should have a problem with saying that S is an additive group.
That's true. All axioms are satisfied, except uniqueness of inverses and the neutral element. What should it be? A FuzzyAbelianGroup?
(4) -> zero?(t-t)
   (4)  false
           Type: Boolean

I don't.
Although zero? doesn't report it, t-t will always behave like the 0 element. So in fact -t is the inverse of t for all practical purposes. But I don't expect Axiom to prove equality where it is impossible to have a proof, just spit out a message like "true up to order n" and then prove equality myself.
The category Ring is reserved for structures with complete equality testing.
Is this the plan for Axiom too?
What will happen to ExpressionField? I recall there are undecidable problems in the latter as well.

Here is a proposal (in SPAD) for a recursive stream generator which looks at all previous elements, not just the last one. It could probably be done with the existing generate(S->S,S), but this one looks more natural.

====================================================================
    Exports == with

      generate: (List S->S,S) -> Stream S
      ++ \spad{generate(f:List S->S,x)} generates an infinite stream
      ++ whose first element is x and whose nth element (\spad{n > 1})
      ++ is f applied to the list of all previous elements.
      ++ Note: \spad{generate(f,x) = [x,f([x]),f([x,f([x])]),..]

    Implementation == add

      lstgen:(List S->S,List S) -> Stream S

      lstgen(f:(List S) -> S,ls:List S):Stream S ==
            delay(ss:=f(ls); concat(ss, lstgen(f,concat(ls, ss))))

      generate(f:(List S)->S,s:S):Stream S == concat(s,lstgen(f,[s]))
====================================================================

again I only could test it as a package due to the bootstrap problem in the spoon.

regards
Franz




reply via email to

[Prev in Thread] Current Thread [Next in Thread]