fact: Definition CacheSpec : ADT CacheSig := ADTRep (Ensemble (Key * Value)) { const "EmptyCache" (_ : unit) : rep := ret (fun _ => False), meth "AddKey" (r : rep, kv : Key * Value) : bool := { r' | (SubEnsembleInsert kv r (fst r')) /\ ((usedKey r (fst kv) /\ snd r' = false) \/ (~ usedKey r (fst kv) /\ snd r' = true))}, meth "UpdateKey" (r : rep, kv : Key * (Value -> Value)) : bool := { r' | (Same_set _ (fst r') (EnsembleUpdate (fst kv) r (snd kv))) /\ ((usedKey r (fst kv) /\ snd r' = true) \/ (~ usedKey r (fst kv) -> snd r' = false))}, meth "LookupKey" (r : rep, k : Key) : option Value := v <- {v | ValidLookup r k v}; ret (r, v) }.
imports: Fiat.Common.Coq__8_4__8_5__Compat Coq.Strings.String Coq.ZArith.ZArith Coq.Lists.List Coq.Logic.FunctionalExtensionality Coq.Sets.Ensembles Computation ADT ADTRefinement ADTNotation BuildADTRefinements KVEnsembles