Product-indexed tuples #
A Lean product indexes a tuple: α × β × γ is one three-component tuple, as products flatten to
the right, while (α × β) × γ has two components, the first a tuple. OneTuple α is the
one-component tuple. Relations and tables use the list-shaped Tup of Cvc.Types.Relation.
A tuple's value is the Lean product it is indexed by, converted with the same flattening.
@[reducible, inline]
Whether a sort is a single tuple component rather than a tuple of its own.
A product cannot be a tuple's last component: its own components would flatten into the tuple.
Equations
- (Cvc.Typ.prod args).isFlat = false
- Cvc.Typ.bool.isFlat = true
- Cvc.Typ.int.isFlat = true
- Cvc.Typ.real.isFlat = true
- Cvc.Typ.string.isFlat = true
- Cvc.Typ.regex.isFlat = true
- Cvc.Typ.roundingMode.isFlat = true
- (Cvc.Typ.bitVec size).isFlat = true
- (Cvc.Typ.float exp sig).isFlat = true
- (Cvc.Typ.finiteField size).isFlat = true
- (Cvc.Typ.arrayTo idx elm).isFlat = true
- (Cvc.Typ.bag elm).isFlat = true
- (Cvc.Typ.set elm).isFlat = true
- (Cvc.Typ.seq elm).isFlat = true
- elm.nullable.isFlat = true
- (Cvc.Typ.record fields).isFlat = true
- (Cvc.Typ.datatype name).isFlat = true
- (dom.function cod).isFlat = true
- (Cvc.Typ.uninterpreted name).isFlat = true
Instances For
The tuple Typ of α then β, flattening a tuple β into its components.
Equations
- Cvc.Srt.prod α (Cvc.Typ.prod args) = Cvc.Typ.prod (α :: args)
- Cvc.Srt.prod α x✝ = Cvc.Typ.prod [α, x✝]
Instances For
@[instance_reducible]
Equations
- Cvc.Srt.instToTypProd = { typ := Cvc.Srt.prod (Cvc.ToTyp.typ α) (Cvc.ToTyp.typ β) }
@[instance_reducible, instance 100]
Lexicographic order on pairs, so that a set, bag or array index of tuples can be written.
A global instance: importing the library brings it into scope.
Equations
@[instance_reducible]
@[instance_reducible]
Equations
- Cvc.instOrdOneTuple = { compare := Cvc.instOrdOneTuple.ord }
@[instance_reducible]
Equations
@[instance_reducible]
Equations
- Cvc.instReprOneTuple = { reprPrec := Cvc.instReprOneTuple.repr }
Equations
- Cvc.instReprOneTuple.repr x✝ prec✝ = Std.Format.bracket "{ " (Std.Format.nil ++ Std.Format.text "value" ++ Std.Format.text " := " ++ (Std.Format.nest 9 (repr x✝.value)).group) " }"
Instances For
@[instance_reducible]
Equations
- Cvc.OneTuple.instToTyp = { typ := Cvc.Typ.prod [Cvc.ToTyp.typ α] }