$SPAD/src/input stream2.input

Timothy Daly December 3, 2016

Abstract

Contents

2

1 License

— license —

--Copyright The Numerical Algorithms Group Limited 1991.

———-

— * —

)set break resume
)spool stream2.output
)set message test on
)set message auto off
)clear all
)set stream calculate 20
)set functions cache all
)set functions compile on
--S 1 of 55
u==[i+j for i in (-4)..10 | i < 5 for j in 4.. | j < 10]
--R
--R                                                                   Type: Void
--E 1
--S 2 of 55
u
--R
--R   Compiling body of rule u to compute value of type Stream(Integer)
--R   u will cache all previously computed values.
--R
--R   (2)  [0,2,4,6,8,10]
--R                                                        Type: Stream(Integer)
--E 2
--S 3 of 55
reduce(0::Integer,+,u)
--R
--R
--R   (3)  30
--R                                                        Type: PositiveInteger
--E 3
)clear all
--S 4 of 55
u(m,n)==[i for i in m..n]
--R
--R                                                                   Type: Void
--E 4

--S 5 of 55
u(3,6)
--R
--R   Compiling function u with type (PositiveInteger,PositiveInteger) ->
--R      List(PositiveInteger)
--R   u will cache all previously computed values.
--R
--R   (2)  [3,4,5,6]
--R                                                  Type: List(PositiveInteger)
--E 5
--S 6 of 55
reduce(+,u(3,6))
--R
--R
--R   (3)  18
--R                                                        Type: PositiveInteger
--E 6
--S 7 of 55
reduce(+,u(3,8))
--R
--R
--R   (4)  33
--R                                                        Type: PositiveInteger
--E 7
)clear all
--S 8 of 55
n==10
--R
--R                                                                   Type: Void
--E 8
--S 9 of 55
u:=[i for i in 0..n]
--R
--R   Compiling body of rule n to compute value of type PositiveInteger
--R   n will cache all previously computed values.
--R
--R   (2)  [0,1,2,3,4,5,6,7,8,9,10]
--R                                               Type: List(NonNegativeInteger)
--E 9
--S 10 of 55
v==[i for i in 0..n]
--R
--R                                                                   Type: Void

--E 10
--S 11 of 55
v
--R
--R   Compiling body of rule v to compute value of type List(
--R      NonNegativeInteger)
--R   v will cache all previously computed values.
--R
--R   (4)  [0,1,2,3,4,5,6,7,8,9,10]
--R                                               Type: List(NonNegativeInteger)
--E 11
--S 12 of 55
n==15
--R
--R   Compiled code for n has been cleared.
--R   Compiled code for v has been cleared.
--R   1 old definition(s) deleted for function or rule n
--R                                                                   Type: Void
--E 12
--S 13 of 55
u
--R
--R
--R   (6)  [0,1,2,3,4,5,6,7,8,9,10]
--R                                               Type: List(NonNegativeInteger)
--E 13
--S 14 of 55
v
--R
--R   Compiling body of rule n to compute value of type PositiveInteger
--R   n will cache all previously computed values.
--R   Compiling body of rule v to compute value of type List(
--R      NonNegativeInteger)
--R   v will cache all previously computed values.
--R
--R   (7)  [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
--R                                               Type: List(NonNegativeInteger)
--E 14
)clear all
--S 15 of 55
n:=2
--R
--R
--R   (1)  2

--R                                                        Type: PositiveInteger
--E 15
--S 16 of 55
m:=3
--R
--R
--R   (2)  3
--R                                                        Type: PositiveInteger
--E 16
--S 17 of 55
u:=[[i*j for j in 1..n] for i in 1..m]
--R
--R
--R   (3)  [[1,2],[2,4],[3,6]]
--R                                            Type: List(List(PositiveInteger))
--E 17
--S 18 of 55
n:=10
--R
--R
--R   (4)  10
--R                                                        Type: PositiveInteger
--E 18
--S 19 of 55
u
--R
--R
--R   (5)  [[1,2],[2,4],[3,6]]
--R                                            Type: List(List(PositiveInteger))
--E 19
)clear all
--S 20 of 55
u==[i for i in m..n]
--R
--R                                                                   Type: Void
--E 20
)set mes test off
--S 21 of 55
u
--R
--R
--R   The lower bound in a loop must be an integer.

--E 21
)set mes test on
--S 22 of 55
n:=7
--R
--R
--R   (2)  7
--R                                                        Type: PositiveInteger
--E 22
--S 23 of 55
m:=3
--R
--R
--R   (3)  3
--R                                                        Type: PositiveInteger
--E 23
--S 24 of 55
u
--R
--R   Compiling body of rule u to compute value of type List(
--R      PositiveInteger)
--R   u will cache all previously computed values.
--R
--R   (4)  [3,4,5,6,7]
--R                                                  Type: List(PositiveInteger)
--E 24
--S 25 of 55
reduce(+,u)
--R
--R
--R   (5)  25
--R                                                        Type: PositiveInteger
--E 25
--S 26 of 55
n:=2
--R
--R
--R   (6)  2
--R                                                        Type: PositiveInteger
--E 26
--S 27 of 55
u
--R

--R
--R   (7)  [3,4,5,6,7]
--R                                                  Type: List(PositiveInteger)
--E 27
--S 28 of 55
reduce(+,u)
--R
--R
--R   (8)  25
--R                                                        Type: PositiveInteger
--E 28
--S 29 of 55
m:=-3
--R
--R   Compiled code for u has been cleared.
--R
--R   (9)  - 3
--R                                                                Type: Integer
--E 29
--S 30 of 55
u
--R
--R   Compiling body of rule u to compute value of type List(Integer)
--R   u will cache all previously computed values.
--R
--R   (10)  [- 3,- 2,- 1,0,1,2]
--R                                                          Type: List(Integer)
--E 30
--S 31 of 55
reduce(+,u)
--R
--R
--R   (11)  - 3
--R                                                                Type: Integer
--E 31
)clear all
--S 32 of 55
u==[[i+j for i in 0..j] for j in 0..n]
--R
--R                                                                   Type: Void
--E 32
)set mes test off

--S 33 of 55
u
--R
--R
--R   The upper bound in a loop must be an integer.
--E 33
)set mes test on
--S 34 of 55
n:=5
--R
--R
--R   (2)  5
--R                                                        Type: PositiveInteger
--E 34
--S 35 of 55
u
--R
--R   Compiling body of rule u to compute value of type List(List(
--R      NonNegativeInteger))
--R   u will cache all previously computed values.
--R
--R   (3)  [[0],[1,2],[2,3,4],[3,4,5,6],[4,5,6,7,8],[5,6,7,8,9,10]]
--R                                         Type: List(List(NonNegativeInteger))
--E 35
--S 36 of 55
n:=10
--R
--R
--R   (4)  10
--R                                                        Type: PositiveInteger
--E 36
--S 37 of 55
u
--R
--R
--R   (5)  [[0],[1,2],[2,3,4],[3,4,5,6],[4,5,6,7,8],[5,6,7,8,9,10]]
--R                                         Type: List(List(NonNegativeInteger))
--E 37
--S 38 of 55
n:=1
--R
--R
--R   (6)  1
--R                                                        Type: PositiveInteger

--E 38
--S 39 of 55
u
--R
--R
--R   (7)  [[0],[1,2],[2,3,4],[3,4,5,6],[4,5,6,7,8],[5,6,7,8,9,10]]
--R                                         Type: List(List(NonNegativeInteger))
--E 39
--S 40 of 55
n:= 0
--R
--R   Compiled code for u has been cleared.
--R
--R   (8)  0
--R                                                     Type: NonNegativeInteger
--E 40
--S 41 of 55
u
--R
--R   Compiling body of rule u to compute value of type List(List(
--R      NonNegativeInteger))
--R   u will cache all previously computed values.
--R
--R   (9)  [[0]]
--R                                         Type: List(List(NonNegativeInteger))
--E 41
--S 42 of 55
n:=-1
--R
--R   Compiled code for u has been cleared.
--R
--R   (10)  - 1
--R                                                                Type: Integer
--E 42
--S 43 of 55
u
--R
--R   Compiling body of rule u to compute value of type List(List(Integer)
--R      )
--R   u will cache all previously computed values.
--R
--R   (11)  []
--R                                                    Type: List(List(Integer))
--E 43

)clear all
)set streams calculate 10
--S 44 of 55
u==[[i+j for i in 0..] for j in 0..]
--R
--R                                                                   Type: Void
--E 44
--S 45 of 55
u
--R
--R   Compiling body of rule u to compute value of type Stream(Stream(
--R      Integer))
--R   u will cache all previously computed values.
--R
--R   (2)
--R   [[0,1,2,3,4,5,6,7,8,9,...], [1,2,3,4,5,6,7,8,9,10,...],
--R    [2,3,4,5,6,7,8,9,10,11,...], [3,4,5,6,7,8,9,10,11,12,...],
--R    [4,5,6,7,8,9,10,11,12,13,...], [5,6,7,8,9,10,11,12,13,14,...],
--R    [6,7,8,9,10,11,12,13,14,15,...], [7,8,9,10,11,12,13,14,15,16,...],
--R    [8,9,10,11,12,13,14,15,16,17,...], [9,10,11,12,13,14,15,16,17,18,...], ...]
--R                                                Type: Stream(Stream(Integer))
--E 45
)clear all
--S 46 of 55
u(m,n)==[[i+j for j in 1..m] for i in 1..n]
--R
--R                                                                   Type: Void
--E 46
--S 47 of 55
u(3,6)
--R
--R   Compiling function u with type (PositiveInteger,PositiveInteger) ->
--R      List(List(PositiveInteger))
--R   u will cache all previously computed values.
--R
--R   (2)  [[2,3,4],[3,4,5],[4,5,6],[5,6,7],[6,7,8],[7,8,9]]
--R                                            Type: List(List(PositiveInteger))
--E 47
--S 48 of 55
reduce(append,u(3,6))
--R
--R
--R   (3)  [2,3,4,3,4,5,4,5,6,5,6,7,6,7,8,7,8,9]

--R                                                  Type: List(PositiveInteger)
--E 48
)clear all
--S 49 of 55
u(m,n)==[[i*j for j in m..] for i in n..]
--R
--R                                                                   Type: Void
--E 49
--S 50 of 55
u(3,6)
--R
--R   Compiling function u with type (PositiveInteger,PositiveInteger) ->
--R      Stream(Stream(Integer))
--R   u will cache all previously computed values.
--R
--R   (2)
--R   [[18,24,30,36,42,48,54,60,66,72,...], [21,28,35,42,49,56,63,70,77,84,...],
--R    [24,32,40,48,56,64,72,80,88,96,...], [27,36,45,54,63,72,81,90,99,108,...],
--R    [30,40,50,60,70,80,90,100,110,120,...],
--R    [33,44,55,66,77,88,99,110,121,132,...],
--R    [36,48,60,72,84,96,108,120,132,144,...],
--R    [39,52,65,78,91,104,117,130,143,156,...],
--R    [42,56,70,84,98,112,126,140,154,168,...],
--R    [45,60,75,90,105,120,135,150,165,180,...], ...]
--R                                                Type: Stream(Stream(Integer))
--E 50
)clear all
)set streams calculate 3
--S 51 of 55
[[[i+j+k for i in 0..] for j in 0..] for k in 0..]
--R
--R
--R   (1)
--R   [[[0,1,2,...],[1,2,3,...],[2,3,4,...],...],
--R    [[1,2,3,...],[2,3,4,...],[3,4,5,...],...],
--R    [[2,3,4,...],[3,4,5,...],[4,5,6,...],...], ...]
--R                                        Type: Stream(Stream(Stream(Integer)))
--E 51
--S 52 of 55
n:=5
--R
--R
--R   (2)  5

--S 53 of 55
[[[i+j+k for i in 0..] for j in 0..] for k in 0..n]
--R
--R
--R   (3)
--R   [[[0,1,2,...],[1,2,3,...],[2,3,4,...],...],
--R    [[1,2,3,...],[2,3,4,...],[3,4,5,...],...],
--R    [[2,3,4,...],[3,4,5,...],[4,5,6,...],...],
--R    [[3,4,5,...],[4,5,6,...],[5,6,7,...],...],
--R    [[4,5,6,...],[5,6,7,...],[6,7,8,...],...],
--R    [[5,6,7,...],[6,7,8,...],[7,8,9,...],...]]
--R                                          Type: List(Stream(Stream(Integer)))
--E 53
--S 54 of 55
[[[i+j+k for i in 0..j] for j in 0..k] for k in 0..]
--R
--R
--R   (4)  [[[0]],[[1],[2,3]],[[2],[3,4],[4,5,6]],...]
--R                                 Type: Stream(List(List(NonNegativeInteger)))
--E 54
--S 55 of 55
[[[i+j+k for i in 0..j] for j in 0..k] for k in 0..n]
--R
--R
--R   (5)
--R   [[[0]], [[1],[2,3]], [[2],[3,4],[4,5,6]], [[3],[4,5],[5,6,7],[6,7,8,9]],
--R    [[4],[5,6],[6,7,8],[7,8,9,10],[8,9,10,11,12]],
--R    [[5],[6,7],[7,8,9],[8,9,10,11],[9,10,11,12,13],[10,11,12,13,14,15]]]
--R                                   Type: List(List(List(NonNegativeInteger)))
--E 55
)spool
)lisp (bye)

———-

References^{[1] nothing}

14