Submaps used to define
(mmp-encode-u-map map i nibble) → map1
This is used in the definition of mmp-encode-c, hence the name.
Here
This function returns the submap (i.e. subset) of
The supremum natural number of the lengths of the keys decreases or remains constant for the submap.
By construction,
every key in the submap has the nibble at position
A nibble array is in the submap iff
it is in the map and has the nibble at position
If
Function:
(defun mmp-encode-u-map (map i nibble) (declare (xargs :guard (and (nibblelist-bytelist-mapp map) (natp i) (nibblep nibble)))) (b* (((unless (mbt (nibblelist-bytelist-mapp map))) nil) ((when (omap::emptyp map)) nil) ((mv key val) (omap::head map)) (nibble (nibble-fix nibble))) (if (eql (nth i key) nibble) (omap::update key val (mmp-encode-u-map (omap::tail map) i nibble)) (mmp-encode-u-map (omap::tail map) i nibble))))
Theorem:
(defthm nibblelist-bytelist-mapp-of-mmp-encode-u-map (b* ((map1 (mmp-encode-u-map map i nibble))) (nibblelist-bytelist-mapp map1)) :rule-classes :rewrite)
Theorem:
(defthm nibblelist-bytelist-map-sup-len-key-of-mmp-encode-u-map-leq (<= (nibblelist-bytelist-map-sup-len-key (mmp-encode-u-map map i nibble)) (nibblelist-bytelist-map-sup-len-key map)) :rule-classes :linear)
Theorem:
(defthm nth-of-key-in-mmp-encode-u-map (implies (and (nibblelist-bytelist-mapp map) (nibblep nibble) (omap::assoc key (mmp-encode-u-map map i nibble))) (equal (nth i key) nibble)))
Theorem:
(defthm in-of-mmp-encode-u-map (implies (and (nibblelist-bytelist-mapp map) (nibblep nibble)) (equal (omap::assoc key (mmp-encode-u-map map i nibble)) (and (equal (nth i key) nibble) (omap::assoc key map)))))
Theorem:
(defthm mmp-encode-c-forall-of-mmp-encode-u-map (implies (and (nibblelist-bytelist-mapp map) (natp i) (nibblep nibble) (nibble-listp l) (mmp-encode-c-forall map i l)) (mmp-encode-c-forall (mmp-encode-u-map map i nibble) (1+ i) (rcons nibble l))))
Theorem:
(defthm mmp-encode-c-max.elementp-of-mmp-encode-u-map (implies (and (nibblelist-bytelist-mapp map) (natp i) (nibblep nibble) (mmp-encode-c-max.elementp map i)) (mmp-encode-c-max.elementp (mmp-encode-u-map map i nibble) (1+ i))))
Theorem:
(defthm mmp-encode-u-map-of-nibblelist-bytelist-mfix-map (equal (mmp-encode-u-map (nibblelist-bytelist-mfix map) i nibble) (mmp-encode-u-map map i nibble)))
Theorem:
(defthm mmp-encode-u-map-nibblelist-bytelist-mequiv-congruence-on-map (implies (nibblelist-bytelist-mequiv map map-equiv) (equal (mmp-encode-u-map map i nibble) (mmp-encode-u-map map-equiv i nibble))) :rule-classes :congruence)
Theorem:
(defthm mmp-encode-u-map-of-nfix-i (equal (mmp-encode-u-map map (nfix i) nibble) (mmp-encode-u-map map i nibble)))
Theorem:
(defthm mmp-encode-u-map-nat-equiv-congruence-on-i (implies (acl2::nat-equiv i i-equiv) (equal (mmp-encode-u-map map i nibble) (mmp-encode-u-map map i-equiv nibble))) :rule-classes :congruence)
Theorem:
(defthm mmp-encode-u-map-of-nibble-fix-nibble (equal (mmp-encode-u-map map i (nibble-fix nibble)) (mmp-encode-u-map map i nibble)))
Theorem:
(defthm mmp-encode-u-map-nibble-equiv-congruence-on-nibble (implies (acl2::nibble-equiv nibble nibble-equiv) (equal (mmp-encode-u-map map i nibble) (mmp-encode-u-map map i nibble-equiv))) :rule-classes :congruence)
Theorem:
(defthm mmp-encode-u-map-when-not-natp-i (implies (and (syntaxp (not (equal i ''0))) (not (natp i))) (equal (mmp-encode-u-map map i nibble) (mmp-encode-u-map map 0 nibble))))
Theorem:
(defthm mmp-encode-u-map-when-not-nibblep-nibble (implies (and (syntaxp (not (equal nibble ''0))) (not (nibblep nibble))) (equal (mmp-encode-u-map map i nibble) (mmp-encode-u-map map i 0))))
Theorem:
(defthm mmp-encode-u-map-when-not-natp-nibble (implies (and (syntaxp (not (equal nibble ''0))) (not (natp nibble))) (equal (mmp-encode-u-map map i nibble) (mmp-encode-u-map map i 0))))