aboutsummaryrefslogtreecommitdiff
path: root/src/hyper/pages/MSET.pht
blob: 09fc5390cad466809476962174d5deceff0da176 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
\begin{patch}{MultiSetXmpPagePatch1}
\begin{paste}{MultiSetXmpPageFull1}{MultiSetXmpPageEmpty1}
\pastebutton{MultiSetXmpPageFull1}{\hidepaste}
\tab{5}\spadcommand{s := multiset [1,2,3,4,5,4,3,2,3,4,5,6,7,4,10]\bound{s }}
\indentrel{3}\begin{verbatim}
   (1)  {7,2: 5,3: 3,1,10,6,4: 4,2: 2}
                         Type: Multiset PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty1}
\begin{paste}{MultiSetXmpPageEmpty1}{MultiSetXmpPagePatch1}
\pastebutton{MultiSetXmpPageEmpty1}{\showpaste}
\tab{5}\spadcommand{s := multiset [1,2,3,4,5,4,3,2,3,4,5,6,7,4,10]\bound{s }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch2}
\begin{paste}{MultiSetXmpPageFull2}{MultiSetXmpPageEmpty2}
\pastebutton{MultiSetXmpPageFull2}{\hidepaste}
\tab{5}\spadcommand{insert!(3,s)\bound{s1 }\free{s }}
\indentrel{3}\begin{verbatim}
   (2)  {7,2: 5,4: 3,1,10,6,4: 4,2: 2}
                         Type: Multiset PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty2}
\begin{paste}{MultiSetXmpPageEmpty2}{MultiSetXmpPagePatch2}
\pastebutton{MultiSetXmpPageEmpty2}{\showpaste}
\tab{5}\spadcommand{insert!(3,s)\bound{s1 }\free{s }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch3}
\begin{paste}{MultiSetXmpPageFull3}{MultiSetXmpPageEmpty3}
\pastebutton{MultiSetXmpPageFull3}{\hidepaste}
\tab{5}\spadcommand{remove!(3,s,1); s\bound{s2 }\free{s1 }}
\indentrel{3}\begin{verbatim}
   (3)  {7,2: 5,3: 3,1,10,6,4: 4,2: 2}
                         Type: Multiset PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty3}
\begin{paste}{MultiSetXmpPageEmpty3}{MultiSetXmpPagePatch3}
\pastebutton{MultiSetXmpPageEmpty3}{\showpaste}
\tab{5}\spadcommand{remove!(3,s,1); s\bound{s2 }\free{s1 }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch4}
\begin{paste}{MultiSetXmpPageFull4}{MultiSetXmpPageEmpty4}
\pastebutton{MultiSetXmpPageFull4}{\hidepaste}
\tab{5}\spadcommand{remove!(5,s); s\bound{s2 }\free{s1 }}
\indentrel{3}\begin{verbatim}
   (4)  {7,3: 3,1,10,6,4: 4,2: 2}
                         Type: Multiset PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty4}
\begin{paste}{MultiSetXmpPageEmpty4}{MultiSetXmpPagePatch4}
\pastebutton{MultiSetXmpPageEmpty4}{\showpaste}
\tab{5}\spadcommand{remove!(5,s); s\bound{s2 }\free{s1 }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch5}
\begin{paste}{MultiSetXmpPageFull5}{MultiSetXmpPageEmpty5}
\pastebutton{MultiSetXmpPageFull5}{\hidepaste}
\tab{5}\spadcommand{count(5,s)\free{s2 }}
\indentrel{3}\begin{verbatim}
   (5)  0
                               Type: NonNegativeInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty5}
\begin{paste}{MultiSetXmpPageEmpty5}{MultiSetXmpPagePatch5}
\pastebutton{MultiSetXmpPageEmpty5}{\showpaste}
\tab{5}\spadcommand{count(5,s)\free{s2 }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch6}
\begin{paste}{MultiSetXmpPageFull6}{MultiSetXmpPageEmpty6}
\pastebutton{MultiSetXmpPageFull6}{\hidepaste}
\tab{5}\spadcommand{t := multiset [2,2,2,-9]\bound{t }}
\indentrel{3}\begin{verbatim}
   (6)  {- 9,3: 2}
                                 Type: Multiset Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty6}
\begin{paste}{MultiSetXmpPageEmpty6}{MultiSetXmpPagePatch6}
\pastebutton{MultiSetXmpPageEmpty6}{\showpaste}
\tab{5}\spadcommand{t := multiset [2,2,2,-9]\bound{t }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch7}
\begin{paste}{MultiSetXmpPageFull7}{MultiSetXmpPageEmpty7}
\pastebutton{MultiSetXmpPageFull7}{\hidepaste}
\tab{5}\spadcommand{U := union(s,t)\bound{U }}
\indentrel{3}\begin{verbatim}
   (7)  {7,3: 3,1,- 9,10,6,4: 4,5: 2}
                                 Type: Multiset Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty7}
\begin{paste}{MultiSetXmpPageEmpty7}{MultiSetXmpPagePatch7}
\pastebutton{MultiSetXmpPageEmpty7}{\showpaste}
\tab{5}\spadcommand{U := union(s,t)\bound{U }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch8}
\begin{paste}{MultiSetXmpPageFull8}{MultiSetXmpPageEmpty8}
\pastebutton{MultiSetXmpPageFull8}{\hidepaste}
\tab{5}\spadcommand{I := intersect(s,t)\bound{I }}
\indentrel{3}\begin{verbatim}
   (8)  {5: 2}
                                 Type: Multiset Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty8}
\begin{paste}{MultiSetXmpPageEmpty8}{MultiSetXmpPagePatch8}
\pastebutton{MultiSetXmpPageEmpty8}{\showpaste}
\tab{5}\spadcommand{I := intersect(s,t)\bound{I }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch9}
\begin{paste}{MultiSetXmpPageFull9}{MultiSetXmpPageEmpty9}
\pastebutton{MultiSetXmpPageFull9}{\hidepaste}
\tab{5}\spadcommand{difference(s,t)\free{s2 t }}
\indentrel{3}\begin{verbatim}
   (9)  {7,3: 3,1,10,6,4: 4}
                                 Type: Multiset Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty9}
\begin{paste}{MultiSetXmpPageEmpty9}{MultiSetXmpPagePatch9}
\pastebutton{MultiSetXmpPageEmpty9}{\showpaste}
\tab{5}\spadcommand{difference(s,t)\free{s2 t }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch10}
\begin{paste}{MultiSetXmpPageFull10}{MultiSetXmpPageEmpty10}
\pastebutton{MultiSetXmpPageFull10}{\hidepaste}
\tab{5}\spadcommand{S := symmetricDifference(s,t)\bound{S }\free{s2 t }}
\indentrel{3}\begin{verbatim}
   (10)  {7,3: 3,1,- 9,10,6,4: 4}
                                 Type: Multiset Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty10}
\begin{paste}{MultiSetXmpPageEmpty10}{MultiSetXmpPagePatch10}
\pastebutton{MultiSetXmpPageEmpty10}{\showpaste}
\tab{5}\spadcommand{S := symmetricDifference(s,t)\bound{S }\free{s2 t }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch11}
\begin{paste}{MultiSetXmpPageFull11}{MultiSetXmpPageEmpty11}
\pastebutton{MultiSetXmpPageFull11}{\hidepaste}
\tab{5}\spadcommand{(U = union(S,I))@Boolean\free{S I U }}
\indentrel{3}\begin{verbatim}
   (11)  true
                                          Type: Boolean
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty11}
\begin{paste}{MultiSetXmpPageEmpty11}{MultiSetXmpPagePatch11}
\pastebutton{MultiSetXmpPageEmpty11}{\showpaste}
\tab{5}\spadcommand{(U = union(S,I))@Boolean\free{S I U }}
\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPagePatch12}
\begin{paste}{MultiSetXmpPageFull12}{MultiSetXmpPageEmpty12}
\pastebutton{MultiSetXmpPageFull12}{\hidepaste}
\tab{5}\spadcommand{t1 := multiset [1,2,2,3]; [t1 < t, t1 < s, t < s, t1 <= s]\free{t s2 }}
\indentrel{3}\begin{verbatim}
   (12)  [false,true,false,true]
                                     Type: List Boolean
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{MultiSetXmpPageEmpty12}
\begin{paste}{MultiSetXmpPageEmpty12}{MultiSetXmpPagePatch12}
\pastebutton{MultiSetXmpPageEmpty12}{\showpaste}
\tab{5}\spadcommand{t1 := multiset [1,2,2,3]; [t1 < t, t1 < s, t < s, t1 <= s]\free{t s2 }}
\end{paste}\end{patch}