SCANL_CONV : conv -> conv

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

where ei is the result of applying the function f to the result of the previous iteration and the current element, i.e., ei = f e(i-1) xi. The iteration starts from the left-hand side (the head) of the list. The user supplied conversion conv is used to derive a theorem|- SCANL f e0 [x1;...xn] = [e0; e1; ...;en]

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

- FAILURE
- SCANL_CONV conv tm fails if tm is not of the form described above, or failure occurs when evaluating conv “f e(i-1) xi”.
- EXAMPLE
- To sum the elements of a list and save the result at each step, one can use SCANL_CONV with ADD_CONV from the library num_lib.In general, if the function f is an explicit lambda abstraction (\x x'. t[x,x']), the conversion should be in the form
- load_library_in_place num_lib; - SCANL_CONV Num_lib.ADD_CONV “SCANL $+ 0 [1;2;3]”; |- SCANL $+ 0[1;2;3] = [0;1;3;6]

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