login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Submitted by : (unknown) at: 2007-11-17T22:00:46-08:00 (9 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

stream2.input.pamphlet

In general this fixes the problems:

  )set functions compile on

but the way axiom is initialized seems to leave something in a broken state which the set command fixes.

Test 1:

  \begin{axiom}
  )set streams calculate 10
  [j for j in 4.. | j < 10 ] 
  \end{axiom}

does not stop.

Test 2:

  \begin{axiom}
  m==[j for j in 4.. | j < 10 ]
  m
  \end{axiom}

causes GCL to exit, CCL to never complete.

but:

axiom
[j for j in 0.. | j < 10 ]

\label{eq1}\left[ 0, \: 1, \: 2, \: 3, \: 4, \: 5, \: 6, \: 7, \: 8, \: 9, \:...\right](1)
Type: Stream(NonNegativeInteger)

works!

issue seems to be 0 vs 4 in loop index

Test 3:

  \begin{axiom}
  )set streams calculate 10
  u==[i+j for i in (-4)..10 | i < 5 for j in 4.. | j < 10]
  u
  \end{axiom}

causes GCL to exit, CCL works.

Test 4:

  \begin{axiom}
  )set streams calculate 10
  u==[i+j for i in 0..10 | i < 5 for j in 0.. | j < 10]
  u
  \end{axiom}

also fails.

issue seems to be end test compile.

Test 5:

  \begin{axiom}
  )set streams calculate 10
  u==[[i+j for i in 0..] for j in 0..]
  u
  \end{axiom}

causes GCL to exit, CCL works.

issue seems to have something to do with macros

because:

  [[i+j for i in 0..] for j in 0..]

works:

  \begin{axiom}
  [[i+j for i in 0..] for j in 0..]
  \end{axiom}

also the sequence:

axiom
)set fun comp on
v==[[i+j for i in 0..] for j in 0..]
Type: Void
axiom
v
axiom
Compiling body of rule v to compute value of type Stream(Stream(
      Integer))

\label{eq2}\begin{array}{@{}l}
\displaystyle
\left[{\left[ 0, \: 1, \: 2, \: 3, \: 4, \: 5, \: 6, \: 7, \: 8, \: 9, \:...\right]}, \:{\left[ 1, \: 2, \: 3, \: 4, \: 5, \: 6, \: 7, \: 8, \: 9, \:{10}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[ 2, \: 3, \: 4, \: 5, \: 6, \: 7, \: 8, \: 9, \:{1
0}, \:{11}, \:...\right]}, \:{\left[ 3, \: 4, \: 5, \: 6, \: 7, \: 8, \: 9, \:{10}, \:{11}, \:{12}, \:...\right]}, \right.
\
\
\displaystyle
\left.\:{\left[ 4, \: 5, \: 6, \: 7, \: 8, \: 9, \:{10}, \:{1
1}, \:{12}, \:{13}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[ 5, \: 6, \: 7, \: 8, \: 9, \:{10}, \:{11}, \:{1
2}, \:{13}, \:{14}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[ 6, \: 7, \: 8, \: 9, \:{10}, \:{11}, \:{12}, \:{1
3}, \:{14}, \:{15}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[ 7, \: 8, \: 9, \:{10}, \:{11}, \:{12}, \:{13}, \:{14}, \:{15}, \:{16}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[ 8, \: 9, \:{10}, \:{11}, \:{12}, \:{13}, \:{14}, \:{15}, \:{16}, \:{17}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[ 9, \:{10}, \:{11}, \:{12}, \:{13}, \:{14}, \:{1
5}, \:{16}, \:{17}, \:{18}, \:...\right]}, \:...\right] 
(2)
Type: Stream(Stream(Integer))

works!

something appears to be set funny when axiom starts.

Test 6:

axiom
)set streams calculate 10
u(m,n)==[[i*j for j in m..] for i in n..]
Type: Void
axiom
u(3,6)
axiom
Compiling function u with type (PositiveInteger,PositiveInteger) -> 
      Stream(Stream(Integer))

\label{eq3}\begin{array}{@{}l}
\displaystyle
\left[{\left[{18}, \:{24}, \:{30}, \:{36}, \:{42}, \:{48}, \:{5
4}, \:{60}, \:{66}, \:{72}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{21}, \:{28}, \:{35}, \:{42}, \:{49}, \:{56}, \:{6
3}, \:{70}, \:{77}, \:{84}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{24}, \:{32}, \:{40}, \:{48}, \:{56}, \:{64}, \:{7
2}, \:{80}, \:{88}, \:{96}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{27}, \:{36}, \:{45}, \:{54}, \:{63}, \:{72}, \:{8
1}, \:{90}, \:{99}, \:{108}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{30}, \:{40}, \:{50}, \:{60}, \:{70}, \:{80}, \:{9
0}, \:{100}, \:{110}, \:{120}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{33}, \:{44}, \:{55}, \:{66}, \:{77}, \:{88}, \:{9
9}, \:{110}, \:{121}, \:{132}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{36}, \:{48}, \:{60}, \:{72}, \:{84}, \:{96}, \:{1
08}, \:{120}, \:{132}, \:{144}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{39}, \:{52}, \:{65}, \:{78}, \:{91}, \:{104}, \:{1
17}, \:{130}, \:{143}, \:{156}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{42}, \:{56}, \:{70}, \:{84}, \:{98}, \:{112}, \:{1
26}, \:{140}, \:{154}, \:{168}, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[{45}, \:{60}, \:{75}, \:{90}, \:{105}, \:{120}, \:{135}, \:{150}, \:{165}, \:{180}, \:...\right]}, \:...\right] (3)
Type: Stream(Stream(Integer))

causes GCL to exit, CCL works.

but:

axiom
)set streams calculate 5
[[[i+j+k for i in 0..] for j in 0..] for k in 0..]

\label{eq4}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
\left[{\left[ 0, \: 1, \: 2, \: 3, \: 4, \:...\right]}, \:{\left[ 1, \: 2, \: 3, \: 4, \: 5, \:...\right]}, \:{\left[ 2, \: 3, \: 4, \: 5, \: 6, \:...\right]}, \: \right.
\
\
\displaystyle
\left.{\left[ 3, \: 4, \: 5, \: 6, \: 7, \:...\right]}, \:{\left[ 4, \: 5, \: 6, \: 7, \: 8, \:...\right]}, \:...\right] 
(4)
Type: Stream(Stream(Stream(Integer)))

works, and

axiom
[i+j+k for i in 0.. for j in 0.. for k in 0..]

\label{eq5}\left[ 0, \: 3, \: 6, \: 9, \:{12}, \:...\right](5)
Type: Stream(NonNegativeInteger)

works!!

Tests 1, 2, 3, 4, and 5 still fail --Bill Page, Sun, 30 Oct 2005 14:50:25 -0600 reply
In the version of Axiom used on MathAction which was compiled from the tla archive on Tuesday August 23, 2005 at 22:37:35

Current Axiom version:

axiom
)version
Value = "FriCAS 2010-12-08 compiled at Thursday March 10, 2011 at 19:56:28 "

Will these work in the pending October 2005 release?

[#165 stream2.input]? --root, Sun, 30 Oct 2005 20:16:55 -0600 reply
no, those are unchanged.

i've been concentrating on the problem of documentation. at present i see that the system is too large and difficult for anyone to really begin to make changes, do real debugging, and add new features; all of which we need.

i'm working on organizing and documenting what i know so others can begin to understand.

the key change in this release and in this direction is the file $AXIOM/doc/bookvol5.dvi This file begins to document the interpreter. A similar file will begin to document the compiler, the browser, the graphics, the algebra, etc.

t

Cleaning issues --Waldek, May 26, 2007 22:11:00 -0500 2007 reply
I have looked at older issues in Issue Tracker and it seems that there are significant number of issues which are just users not understanding what Axiom is doing and expecting different result.

For example issue 165 the user clearly do not understand that that Axiom blindly performs specified computations and that:

   [j for j in 4.. | j < 10 ]

simply is an infinite loop. Correct stream computation work because they eventually produce some output and compuation is aborted when sufficently many elements are produced, but this one just loops without producing any output.

BTW, my impression is that this issue is a duplicate.

documented behaviour --kratt6, Fri, 04 Jan 2008 04:23:12 -0800 reply
Status: open => duplicate

see also #375

Name: #165 stream2.input => #165 stream2.input infinite loops with streams




  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: