- finmap_TY_DEF
-
|- ?rep. TYPE_DEFINITION (TRP (\v tl. (?x. v = x) /\ (LENGTH tl = 0))) rep
- finmap_ISO_DEF
-
|- (!a. ABS_finmap (REP_finmap a) = a) /\
(!r.
TRP (\v tl. (?x. v = x) /\ (LENGTH tl = 0)) r =
REP_finmap (ABS_finmap r) =
r)
- FINMAP_DEF
-
|- !x. FINMAP x = ABS_finmap (Node x [])
- FINMAP_arg_DEF
-
|- !l. FINMAP_arg (FINMAP l) = l
- empty_finmap_DEF
-
|- empty_finmap = FINMAP []
- list_lookup_DEF
-
|- (!key. list_lookup key [] = undefined) /\
(!key t h.
list_lookup key (CONS h t) =
((key = FST h) => (lift (SND h)) | (list_lookup key t)))
- finmap_lookup_DEF
-
|- !key l. finmap_lookup key (FINMAP l) = list_lookup key l
- list_insert_DEF
-
|- (!less key item. list_insert less key item [] = [key,item]) /\
(!less key item t h.
list_insert less key item (CONS h t) =
((less (FST h) key)
=> (CONS h (list_insert less key item t))
| ((key = FST h)
=> (CONS (key,item) t)
| (CONS (key,item) (CONS h t)))))
- finmap_insert_DEF
-
|- !less key item l.
finmap_insert less key item (FINMAP l) =
FINMAP (list_insert less key item l)
- list_modify_DEF
-
|- (!less f. list_modify less f [] = f) /\
(!less f t h.
list_modify less f (CONS h t) =
list_modify less (list_insert less (FST h) (SND h) f) t)
- finmap_modify_DEF
-
|- !less f g.
finmap_modify less f g =
((f = empty_finmap)
=> g
| (FINMAP (list_modify less (FINMAP_arg f) (FINMAP_arg g))))
- list_max_DEF
-
|- (list_max [] = 0) /\
(!l n. list_max (CONS n l) = ((list_max l < n) => n | (list_max l)))
- list_member_DEF
-
|- (!item. list_member item [] = F) /\
(!item t h.
list_member item (CONS h t) = ((h = item) => T | (list_member item t)))
- dom_list_helper_DEF
-
|- (dom_list_helper [] = []) /\
(!t h. dom_list_helper (CONS h t) = CONS (FST h) (dom_list_helper t))
- dom_list_DEF
-
|- !l. dom_list (FINMAP l) = dom_list_helper l
- finmap_dom_DEF
-
|- !l. finmap_dom (FINMAP l) = FOLDR (\x s. FST x INSERT s) l {}
- finmap_range_DEF
-
|- !l. finmap_range (FINMAP l) = FOLDR (\x s. SND x INSERT s) l {}
- restrict_finmap_DEF
-
|- !f set.
restrict_finmap (FINMAP f) set = FINMAP (FILTER (\x. FST x IN set) f)
- bij_inv_DEF
-
|- !f1 f2.
bij_inv f1 f2 =
ONE_ONE f1 /\ ONTO f1 /\ (!a. f2 (f1 a) = a) /\ (!b. f1 (f2 b) = b)
- in_dom_DEF
-
|- !f x. in_dom f x = list_member x (dom_list f)
- next_dom_DEF
-
|- !less f.
next_dom less f = (@a. ~(in_dom f a) /\ (!a'. less a' a ==> in_dom f a'))
- ne_length_DEF
-
|- (!x. ne_length (ONE x) = 0) /\
(!n x. ne_length (MORE x n) = ne_length n + 1)