$SPAD/src/input mset2.input

Timothy Daly December 3, 2016

Abstract

Contents

2

1 License

— license —

--Copyright The Numerical Algorithms Group Limited 1991.

———-

— * —

)set break resume
)spool mset2.output
)set message test on
)set message auto off
)clear all
--S 1 of 12
s := multiset [1,2,3,4,5,4,3,2,3,4,5,6,7,4,10]
--R
--R
--R   (1)  {1,2: 2,3: 3,4: 4,2: 5,6,7,10}
--R                                              Type: Multiset(PositiveInteger)
--E 1
--S 2 of 12
insert!(3,s)
--R
--R
--R   (2)  {1,2: 2,4: 3,4: 4,2: 5,6,7,10}
--R                                              Type: Multiset(PositiveInteger)
--E 2
--S 3 of 12
remove!(3,s,1); s
--R
--R
--R   (3)  {1,2: 2,3: 3,4: 4,2: 5,6,7,10}
--R                                              Type: Multiset(PositiveInteger)
--E 3
--S 4 of 12
remove!(5,s); s
--R
--R
--R   (4)  {1,2: 2,3: 3,4: 4,6,7,10}
--R                                              Type: Multiset(PositiveInteger)
--E 4
--S 5 of 12
count(5,s)
--R

--R
--R   (5)  0
--R                                                     Type: NonNegativeInteger
--E 5
--S 6 of 12
t := multiset [2,2,2,-9]
--R
--R
--R   (6)  {3: 2,- 9}
--R                                                      Type: Multiset(Integer)
--E 6
--S 7 of 12
U := union(s,t)
--R
--R
--R   (7)  {1,5: 2,3: 3,4: 4,6,7,10,- 9}
--R                                                      Type: Multiset(Integer)
--E 7
--S 8 of 12
I := intersect(s,t)
--R
--R
--R   (8)  {5: 2}
--R                                                      Type: Multiset(Integer)
--E 8
--S 9 of 12
difference(s,t)
--R
--R
--R   (9)  {1,3: 3,4: 4,6,7,10}
--R                                                      Type: Multiset(Integer)
--E 9
--S 10 of 12
S := symmetricDifference(s,t)
--R
--R
--R   (10)  {1,3: 3,4: 4,6,7,10,- 9}
--R                                                      Type: Multiset(Integer)
--E 10
--S 11 of 12
(U = union(S,I))@Boolean
--R
--R
--R   (11)  true

--R                                                                Type: Boolean
--E 11
--S 12 of 12
t1 := multiset [1,2,2,3]; [t1 < t, t1 < s, t < s, t1 <= s]
--R
--R
--R   (12)  [false,true,false,true]
--R                                                          Type: List(Boolean)
--E 12
)spool
)lisp (bye)

———-

References^{[1] nothing}

6