\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)  {1, 2 : 2, 3 : 3, 4 : 4, 2 : 5, 6, 7, 10}
                        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)  {1, 2 : 2, 4 : 3, 4 : 4, 2 : 5, 6, 7, 10}
                        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)  {1, 2 : 2, 3 : 3, 4 : 4, 2 : 5, 6, 7, 10}
                        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)  {1, 2 : 2, 3 : 3, 4 : 4, 6, 7, 10}
                        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)  {3 : 2, - 9}
                                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)  {10, 7, 6, 4 : 4, 3 : 3, 5 : 2, 1, - 9}
                                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)  {10, 7, 6, 4 : 4, 3 : 3, 1}
                                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)  {1, 3 : 3, 4 : 4, 6, 7, 10, - 9}
                                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}

