src/Doc/IsarImplementation/ML.thy
changeset 53071 1958a5e65ea5
parent 52733 98f94010d78d
child 53163 7c2b13a53d69
equal deleted inserted replaced
53061:417cb0f713e0 53071:1958a5e65ea5
   798   difference is even more significant in higher-order logic, because
   798   difference is even more significant in higher-order logic, because
   799   the redundant tuple structure needs to be accommodated by formal
   799   the redundant tuple structure needs to be accommodated by formal
   800   reasoning.}
   800   reasoning.}
   801 
   801 
   802   Currying gives some flexiblity due to \emph{partial application}.  A
   802   Currying gives some flexiblity due to \emph{partial application}.  A
   803   function @{text "f: \<tau>\<^sub>1 \<rightarrow> \<tau>\<^bsub>2\<^esub> \<rightarrow> \<tau>"} can be applied to @{text "x: \<tau>\<^sub>1"}
   803   function @{text "f: \<tau>\<^sub>1 \<rightarrow> \<tau>\<^sub>2 \<rightarrow> \<tau>"} can be applied to @{text "x: \<tau>\<^sub>1"}
   804   and the remaining @{text "(f x): \<tau>\<^sub>2 \<rightarrow> \<tau>"} passed to another function
   804   and the remaining @{text "(f x): \<tau>\<^sub>2 \<rightarrow> \<tau>"} passed to another function
   805   etc.  How well this works in practice depends on the order of
   805   etc.  How well this works in practice depends on the order of
   806   arguments.  In the worst case, arguments are arranged erratically,
   806   arguments.  In the worst case, arguments are arranged erratically,
   807   and using a function in a certain situation always requires some
   807   and using a function in a certain situation always requires some
   808   glue code.  Thus we would get exponentially many oppurtunities to
   808   glue code.  Thus we would get exponentially many oppurtunities to
   902 text {* As explained above, a function @{text "f: \<alpha> \<rightarrow> \<beta> \<rightarrow> \<beta>"} can be
   902 text {* As explained above, a function @{text "f: \<alpha> \<rightarrow> \<beta> \<rightarrow> \<beta>"} can be
   903   understood as update on a configuration of type @{text "\<beta>"},
   903   understood as update on a configuration of type @{text "\<beta>"},
   904   parametrized by arguments of type @{text "\<alpha>"}.  Given @{text "a: \<alpha>"}
   904   parametrized by arguments of type @{text "\<alpha>"}.  Given @{text "a: \<alpha>"}
   905   the partial application @{text "(f a): \<beta> \<rightarrow> \<beta>"} operates
   905   the partial application @{text "(f a): \<beta> \<rightarrow> \<beta>"} operates
   906   homogeneously on @{text "\<beta>"}.  This can be iterated naturally over a
   906   homogeneously on @{text "\<beta>"}.  This can be iterated naturally over a
   907   list of parameters @{text "[a\<^sub>1, \<dots>, a\<^sub>n]"} as @{text "f a\<^sub>1 #> \<dots> #> f
   907   list of parameters @{text "[a\<^sub>1, \<dots>, a\<^sub>n]"} as @{text "f a\<^sub>1 #> \<dots> #> f a\<^sub>n"}.
   908   a\<^bsub>n\<^esub>\<^bsub>\<^esub>"}.  The latter expression is again a function @{text "\<beta> \<rightarrow> \<beta>"}.
   908   The latter expression is again a function @{text "\<beta> \<rightarrow> \<beta>"}.
   909   It can be applied to an initial configuration @{text "b: \<beta>"} to
   909   It can be applied to an initial configuration @{text "b: \<beta>"} to
   910   start the iteration over the given list of arguments: each @{text
   910   start the iteration over the given list of arguments: each @{text
   911   "a"} in @{text "a\<^sub>1, \<dots>, a\<^sub>n"} is applied consecutively by updating a
   911   "a"} in @{text "a\<^sub>1, \<dots>, a\<^sub>n"} is applied consecutively by updating a
   912   cumulative configuration.
   912   cumulative configuration.
   913 
   913