If I follow the question Raymond Rogers raised (I did not
receive all the email for some reason), and Ralf's reply
below, I don't think Axiom is that different, and the
problem that Stream cannot "look inside" the parameter f
is not because Axiom is compiled. Rather it is the nature
that f is passed as a function, which by definition, has a
source domain and a target domain, and computes values and
nothing more. If the aim is to "know" more about f inside
Stream (or a calling function/domain), then one should
change the property of the parameter in Stream and hence
create a new domain, say call StreamMore, where the
function f is wrapped into a domain, say
FunctionDomain(f), and inside FunctionDomain(f) you have
auxiliary functions such as isFunctionRandom?(f), and any
other properties of f that you would like StreamMore to
access or query.
This is not different from OOP where the properties of f
are provided by methods, like f.isFunctionRandom?.
In general, when a parameter is passed to another function
(or a domain like Stream), only its categorical properties
(here the definition of what a set function is, with
source and target, and the production of values, but not
details of the computation itself) are known from inside
the calling function (or calling domain). Such
"restrictions" are universal in computer programming
languages.
At least, that's my limited understanding.
William
On Tue, 21 Oct 2014 14:50:00 -0400
Raymond Rogers <[email protected]> wrote:
On 10/21/2014 04:39 PM, Raymond Rogers wrote:
Let's think about this.
I think the question can be interpreted as a
formating/display problem
for the underlying code.
If you believe so... Let me state it a bit differently
what
datastructure comes out of the series command. Or rather
what is stored
inside the data structure.
Here an example:
(1) -> Z==>Integer; Q==>Fraction Z;
Type:
Void
(2) -> f(q:Q):Q ==
truncate(abs(q*cos(q::Float))+1)*(q/2+1)
Function declaration f : Fraction(Integer) ->
Fraction(Integer) has
been added to workspace.
Type:
Void
(3) -> s: Stream Q := stream(f, 0)
Compiling function f with type Fraction(Integer) ->
Fraction(Integer
)
3 7 15 31 63 127 255 511
(3) [0,1,-,-,--,--,--,---,---,---,...]
2 4 8 16 32 64 128 256
Type:
Stream(Fraction(Integer))
(4) -> p:=series(s)$UnivariateFormalPowerSeries(Q)
(4)
3 2 7 3 15 4 31 5 63 6 127 7
255 8 511 9
x + - x + - x + -- x + -- x + -- x + --- x +
--- x + --- x
2 4 8 16 32 64
128 256
+
1023 10 11
---- x + O(x )
512
Type:
UnivariateFormalPowerSeries(Fraction(Integer))
The only thing that s (the Stream) knows is a function
object f (if you
like you can use f=random). It cannot look inside f
except to ask for
more values. Remember AXIOM code is compiled.
If from that you would somehow be able to extract a
pattern, great, but
I doubt.
Of course I am not that familiar with the Axiom
internals.
Well, you might come from another CAS. AXIOM *is*
different. It is in
general *not* dealing with expression trees. So what you
have in mind
(adding presentation) does not work for Stream of
Series.
That is not saying that it is impossible, but rather
that the Stream and
PowerSeries domains are not appropriate for what you
have in mind. (And
at the moment I don't think there is anything like what
you want in Axiom.)
Ralf
_______________________________________________
Axiom-developer mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/axiom-developer
William Sit, Professor Emeritus
Mathematics, City College of New York
Office: R6/291D Tel: 212-650-5179
Home Page: http://scisun.sci.ccny.cuny.edu/~wyscc/
_______________________________________________
Axiom-developer mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/axiom-developer