doc-src/IsarImplementation/Thy/document/ML.tex
changeset 40802 3cd23f676c5b
parent 40508 76894f975440
child 40964 482a8334ee9e
equal deleted inserted replaced
40801:6cfacec435e6 40802:3cd23f676c5b
    87 %
    87 %
    88 \begin{isamarkuptext}%
    88 \begin{isamarkuptext}%
    89 Isabelle source files have a certain standardized header
    89 Isabelle source files have a certain standardized header
    90   format (with precise spacing) that follows ancient traditions
    90   format (with precise spacing) that follows ancient traditions
    91   reaching back to the earliest versions of the system by Larry
    91   reaching back to the earliest versions of the system by Larry
    92   Paulson.  See \hyperlink{file.~~/src/Pure/thm.ML}{\mbox{\isa{\isatt{{\isaliteral{7E}{\isachartilde}}{\isaliteral{7E}{\isachartilde}}{\isaliteral{2F}{\isacharslash}}src{\isaliteral{2F}{\isacharslash}}Pure{\isaliteral{2F}{\isacharslash}}thm{\isaliteral{2E}{\isachardot}}ML}}}}, for example.
    92   Paulson.  See \verb|~~/src/Pure/thm.ML|, for example.
    93 
    93 
    94   The header includes at least \verb|Title| and \verb|Author| entries, followed by a prose description of the purpose of
    94   The header includes at least \verb|Title| and \verb|Author| entries, followed by a prose description of the purpose of
    95   the module.  The latter can range from a single line to several
    95   the module.  The latter can range from a single line to several
    96   paragraphs of explanations.
    96   paragraphs of explanations.
    97 
    97 
  1643 
  1643 
  1644   Literal integers in ML text are forced to be of this one true
  1644   Literal integers in ML text are forced to be of this one true
  1645   integer type --- overloading of SML97 is disabled.
  1645   integer type --- overloading of SML97 is disabled.
  1646 
  1646 
  1647   Structure \verb|IntInf| of SML97 is obsolete and superseded by
  1647   Structure \verb|IntInf| of SML97 is obsolete and superseded by
  1648   \verb|Int|.  Structure \verb|Integer| in \hyperlink{file.~~/src/Pure/General/integer.ML}{\mbox{\isa{\isatt{{\isaliteral{7E}{\isachartilde}}{\isaliteral{7E}{\isachartilde}}{\isaliteral{2F}{\isacharslash}}src{\isaliteral{2F}{\isacharslash}}Pure{\isaliteral{2F}{\isacharslash}}General{\isaliteral{2F}{\isacharslash}}integer{\isaliteral{2E}{\isachardot}}ML}}}} provides some additional
  1648   \verb|Int|.  Structure \verb|Integer| in \verb|~~/src/Pure/General/integer.ML| provides some additional
  1649   operations.
  1649   operations.
  1650 
  1650 
  1651   \end{description}%
  1651   \end{description}%
  1652 \end{isamarkuptext}%
  1652 \end{isamarkuptext}%
  1653 \isamarkuptrue%
  1653 \isamarkuptrue%
  1728 \endisadelimmlref
  1728 \endisadelimmlref
  1729 %
  1729 %
  1730 \begin{isamarkuptext}%
  1730 \begin{isamarkuptext}%
  1731 Apart from \verb|Option.map| most operations defined in
  1731 Apart from \verb|Option.map| most operations defined in
  1732   structure \verb|Option| are alien to Isabelle/ML.  The
  1732   structure \verb|Option| are alien to Isabelle/ML.  The
  1733   operations shown above are defined in \hyperlink{file.~~/src/Pure/General/basics.ML}{\mbox{\isa{\isatt{{\isaliteral{7E}{\isachartilde}}{\isaliteral{7E}{\isachartilde}}{\isaliteral{2F}{\isacharslash}}src{\isaliteral{2F}{\isacharslash}}Pure{\isaliteral{2F}{\isacharslash}}General{\isaliteral{2F}{\isacharslash}}basics{\isaliteral{2E}{\isachardot}}ML}}}}, among others.%
  1733   operations shown above are defined in \verb|~~/src/Pure/General/basics.ML|, among others.%
  1734 \end{isamarkuptext}%
  1734 \end{isamarkuptext}%
  1735 \isamarkuptrue%
  1735 \isamarkuptrue%
  1736 %
  1736 %
  1737 \isamarkupsubsection{Lists%
  1737 \isamarkupsubsection{Lists%
  1738 }
  1738 }
  1769   The curried \verb|cons| amends this, but it should be only used when
  1769   The curried \verb|cons| amends this, but it should be only used when
  1770   partial application is required.
  1770   partial application is required.
  1771 
  1771 
  1772   \item \verb|member|, \verb|insert|, \verb|remove|, \verb|update| treat
  1772   \item \verb|member|, \verb|insert|, \verb|remove|, \verb|update| treat
  1773   lists as a set-like container that maintains the order of elements.
  1773   lists as a set-like container that maintains the order of elements.
  1774   See \hyperlink{file.~~/src/Pure/library.ML}{\mbox{\isa{\isatt{{\isaliteral{7E}{\isachartilde}}{\isaliteral{7E}{\isachartilde}}{\isaliteral{2F}{\isacharslash}}src{\isaliteral{2F}{\isacharslash}}Pure{\isaliteral{2F}{\isacharslash}}library{\isaliteral{2E}{\isachardot}}ML}}}} for the full specifications
  1774   See \verb|~~/src/Pure/library.ML| for the full specifications
  1775   (written in ML).  There are some further derived operations like
  1775   (written in ML).  There are some further derived operations like
  1776   \verb|union| or \verb|inter|.
  1776   \verb|union| or \verb|inter|.
  1777 
  1777 
  1778   Note that \verb|insert| is conservative about elements that are
  1778   Note that \verb|insert| is conservative about elements that are
  1779   already a \verb|member| of the list, while \verb|update| ensures that
  1779   already a \verb|member| of the list, while \verb|update| ensures that
  1875   insertion via \verb|fold_rev| attempts to preserve the order of
  1875   insertion via \verb|fold_rev| attempts to preserve the order of
  1876   elements in the result.
  1876   elements in the result.
  1877 
  1877 
  1878   This way of merging lists is typical for context data
  1878   This way of merging lists is typical for context data
  1879   (\secref{sec:context-data}).  See also \verb|merge| as defined in
  1879   (\secref{sec:context-data}).  See also \verb|merge| as defined in
  1880   \hyperlink{file.~~/src/Pure/library.ML}{\mbox{\isa{\isatt{{\isaliteral{7E}{\isachartilde}}{\isaliteral{7E}{\isachartilde}}{\isaliteral{2F}{\isacharslash}}src{\isaliteral{2F}{\isacharslash}}Pure{\isaliteral{2F}{\isacharslash}}library{\isaliteral{2E}{\isachardot}}ML}}}}.%
  1880   \verb|~~/src/Pure/library.ML|.%
  1881 \end{isamarkuptext}%
  1881 \end{isamarkuptext}%
  1882 \isamarkuptrue%
  1882 \isamarkuptrue%
  1883 %
  1883 %
  1884 \isamarkupsubsection{Association lists%
  1884 \isamarkupsubsection{Association lists%
  1885 }
  1885 }
  1919 
  1919 
  1920   \end{description}
  1920   \end{description}
  1921 
  1921 
  1922   Association lists are adequate as simple and light-weight
  1922   Association lists are adequate as simple and light-weight
  1923   implementation of finite mappings in many practical situations.  A
  1923   implementation of finite mappings in many practical situations.  A
  1924   more heavy-duty table structure is defined in \hyperlink{file.~~/src/Pure/General/table.ML}{\mbox{\isa{\isatt{{\isaliteral{7E}{\isachartilde}}{\isaliteral{7E}{\isachartilde}}{\isaliteral{2F}{\isacharslash}}src{\isaliteral{2F}{\isacharslash}}Pure{\isaliteral{2F}{\isacharslash}}General{\isaliteral{2F}{\isacharslash}}table{\isaliteral{2E}{\isachardot}}ML}}}}; that version scales easily to
  1924   more heavy-duty table structure is defined in \verb|~~/src/Pure/General/table.ML|; that version scales easily to
  1925   thousands or millions of elements.%
  1925   thousands or millions of elements.%
  1926 \end{isamarkuptext}%
  1926 \end{isamarkuptext}%
  1927 \isamarkuptrue%
  1927 \isamarkuptrue%
  1928 %
  1928 %
  1929 \isamarkupsubsection{Unsynchronized references%
  1929 \isamarkupsubsection{Unsynchronized references%
  2288   signal to all waiting threads on the associated condition variable,
  2288   signal to all waiting threads on the associated condition variable,
  2289   and returns the result \isa{y}.
  2289   and returns the result \isa{y}.
  2290 
  2290 
  2291   \end{description}
  2291   \end{description}
  2292 
  2292 
  2293   There are some further variants of the \verb|Synchronized.guarded_access| combinator, see \hyperlink{file.~~/src/Pure/Concurrent/synchronized.ML}{\mbox{\isa{\isatt{{\isaliteral{7E}{\isachartilde}}{\isaliteral{7E}{\isachartilde}}{\isaliteral{2F}{\isacharslash}}src{\isaliteral{2F}{\isacharslash}}Pure{\isaliteral{2F}{\isacharslash}}Concurrent{\isaliteral{2F}{\isacharslash}}synchronized{\isaliteral{2E}{\isachardot}}ML}}}} for details.%
  2293   There are some further variants of the \verb|Synchronized.guarded_access| combinator, see \verb|~~/src/Pure/Concurrent/synchronized.ML| for details.%
  2294 \end{isamarkuptext}%
  2294 \end{isamarkuptext}%
  2295 \isamarkuptrue%
  2295 \isamarkuptrue%
  2296 %
  2296 %
  2297 \endisatagmlref
  2297 \endisatagmlref
  2298 {\isafoldmlref}%
  2298 {\isafoldmlref}%
  2355 \isadelimML
  2355 \isadelimML
  2356 %
  2356 %
  2357 \endisadelimML
  2357 \endisadelimML
  2358 %
  2358 %
  2359 \begin{isamarkuptext}%
  2359 \begin{isamarkuptext}%
  2360 \medskip See \hyperlink{file.~~/src/Pure/Concurrent/mailbox.ML}{\mbox{\isa{\isatt{{\isaliteral{7E}{\isachartilde}}{\isaliteral{7E}{\isachartilde}}{\isaliteral{2F}{\isacharslash}}src{\isaliteral{2F}{\isacharslash}}Pure{\isaliteral{2F}{\isacharslash}}Concurrent{\isaliteral{2F}{\isacharslash}}mailbox{\isaliteral{2E}{\isachardot}}ML}}}} how
  2360 \medskip See \verb|~~/src/Pure/Concurrent/mailbox.ML| how
  2361   to implement a mailbox as synchronized variable over a purely
  2361   to implement a mailbox as synchronized variable over a purely
  2362   functional queue.%
  2362   functional queue.%
  2363 \end{isamarkuptext}%
  2363 \end{isamarkuptext}%
  2364 \isamarkuptrue%
  2364 \isamarkuptrue%
  2365 %
  2365 %