LIST_CONV : conv
CONST1 ... (CONST2 ...) ...
|- CONST1 ...l... = fold f e l
|- SUM l = FOLDR $+ 0 l
|- SUM (CONS x l) = x + (SUM l)
|- MONOID $+ 0
|- SUM (APPEND l1 l2) = (SUM l1) + (SUM l2)
CONST2 | side conditions | tm2 in result |- tm1 = tm2 ==============|================================|=========================== [] | NONE | e [x] | NONE | f x e CONS x l | NONE | f x (CONST1 l) SNOC x l | e is a list variable | CONST1 (f x e) l APPEND l1 l2 | e is a list variable | CONST1 (CONST1 l1) l2 APPEND l1 l2 | |- FCOMM g f, |- LEFT_ID g e | g (CONST1 l1) (CONST2 l2) FLAT l1 | |- FCOMM g f, |- LEFT_ID g e, | | |- CONST3 l = FOLDR g e l | CONST3 (MAP CONST1 l) REVERSE l | |- COMM f, |- ASSOC f | CONST1 l REVERSE l | f == (\x l. h (g x) l) | | |- COMM h, |- ASSOC h | CONST1 l
CONST2 | side conditions | tm2 in result |- tm1 = tm2 ==============|================================|=========================== [] | NONE | e [x] | NONE | f x e SNOC x l | NONE | f x (CONST1 l) CONS x l | e is a list variable | CONST1 (f x e) l APPEND l1 l2 | e is a list variable | CONST1 (CONST1 l1) l2 APPEND l1 l2 | |- FCOMM f g, |- RIGHT_ID g e | g (CONST1 l1) (CONST2 l2) FLAT l1 | |- FCOMM f g, |- RIGHT_ID g e, | | |- CONST3 l = FOLDR g e l | CONST3 (MAP CONST1 l) REVERSE l | |- COMM f, |- ASSOC f | CONST1 l REVERSE l | f == (\l x. h l (g x)) | | |- COMM h, |- ASSOC h | CONST1 l
Auxiliary theorems are held in a user-updatable database. In particular, definitions of constants in terms of FOLDR and FOLDL, and monoid, commutativity, associativity, left identity, right identity and binary function commutativity theorems are stored. The database can be updated by the user to allow LIST_CONV to prove theorems about new constants. This is done by calling set_list_thm_database. The database can be inspected by calling list_thm_database. The database initially holds FOLDR/L theorems for the following system constants: APPEND, FLAT, LENGTH, NULL, REVERSE, MAP, FILTER, ALL_EL, SUM, SOME_EL, IS_EL, AND_EL, OR_EL, PREFIX, SUFFIX, SNOC and FLAT combined with REVERSE. It also holds auxiliary theorems about their step functions and base elements.
- LIST_CONV (--`LENGTH ([]:'a list)`--); |- LENGTH [] = 0
- LIST_CONV (--`APPEND (CONS h t) (l1:'a list)`--); |- APPEND (CONS h t) l1 = CONS h (APPEND t l1)
- LIST_CONV (--`APPEND (l1:'a list) (CONS h t)`--); |- APPEND l1 (CONS h t) = APPEND (SNOC h l1) t
- LIST_CONV (--`MAP (P:'a list -> 'a) (SNOC h t)`--); |- MAP P (SNOC h t) = SNOC (P h) (MAP P t)
- LIST_CONV (--`SUM (FLAT l)`--); |- SUM (FLAT l) = SUM (MAP SUM l)
- LIST_CONV (--`NULL (REVERSE (l:bool list))`--); |- NULL (REVERSE l) = NULL l