FOLDL_CONV : conv -> conv

- STRUCTURE
- SYNOPSIS
- Computes by inference the result of applying a function to the elements of a list.
- DESCRIPTION
- FOLDL_CONV takes a conversion conv and a term tm in the following form:It returns the theorem
FOLDL f e [x0;...xn]

where tm' is the result of applying the function f iteratively to the successive elements of the list and the result of the previous application starting from the tail end of the list. During each iteration, an expression f ei xi is evaluated. The user supplied conversion conv is used to derive a theorem|- FOLDL f e [x0;...xn] = tm'

which is used in the next iteration.|- f ei xi = e(i+1)

- FAILURE
- FOLDL_CONV conv tm fails if tm is not of the form described above.
- EXAMPLE
- To sum the elements of a list, one can use FOLDL_CONV with REDUCE_CONV from the library numLib.In general, if the function f is an explicit lambda abstraction (\x x'. t[x,x']), the conversion should be in the form
- FOLDL_CONV numLib.REDUCE_CONV ``FOLDL $+ 0 [0;1;2;3]``; val it = |- FOLDL $+ 0 [0;1;2;3] = 6 : thm

where conv' applied to t[x,x'] returns the theorem((RATOR_CONV BETA_CONV) THENC BETA_CONV THENC conv'))

|-t[x,x'] = e''.

- SEEALSO

HOL Kananaskis-14