Bags #
The Lean type denoting an SMT bag: a Std.TreeMap from elements to their multiplicity, so the
element type must be ordered. Multiplicities are positive: the functions below drop an element whose
multiplicity reaches zero, and subtraction stops there, as SMT's bag difference does.
Converting a bag to a term and back is done by Cvc.Untyped.Theory.Bag and
Cvc.Typed.Theory.Bag.
The empty bag.
Equations
Instances For
Applies f to an element's multiplicity, removing the element when the result is zero.
Equations
Instances For
An element's multiplicity, none if absent.
Equations
- bag.get? key = Std.TreeMap.get? bag key
Instances For
@[instance_reducible]
Equations
- Cvc.Bag.instMembership = { mem := Cvc.Bag.mem }
@[instance_reducible]
Equations
- Cvc.Bag.instToString = { toString := Cvc.Bag.toString }
@[instance_reducible]
Equations
- Cvc.Bag.instToTyp = { typ := Cvc.Typ.bag (Cvc.Typ?.typ (Cvc.ToTyp.typ α)) }
@[instance_reducible]
Equations
- Cvc.Bag.instOrd = { compare := Cvc.Bag.compare }