Quantifiers, sort-erased #
A quantified formula binds its variables the way a lambda does: they are BVars gathered into a
variable list, and the body mentions them as ordinary terms. Two spellings are offered.
mkForall/mkExiststake the bound variables explicitly, asBVars.lambdadoes.forallH/existsHtake the body as a Lean function of the variables, so that noBVaris ever written by hand. TheHis for higher-order abstract syntax: binding is borrowed from Lean's ownfun.
A quantifier binds at least one variable, cvc5 rejecting an empty variable list. Asserting a
quantified formula needs a logic with quantifiers, such as the default ALL; a QF_ logic rejects
it.
cvc5's WITNESS binder is deliberately not wrapped: asserting a term that contains one aborts the
process rather than raising an error.
Universal quantification of body over bvs.
Equations
- Cvc.Untyped.Term.mkForall bvs body _nonEmpty = Cvc.Untyped.Term.mkQuant✝ cvc5.Kind.FORALL bvs body
Instances For
Existential quantification of body over bvs.
Equations
- Cvc.Untyped.Term.mkExists bvs body _nonEmpty = Cvc.Untyped.Term.mkQuant✝ cvc5.Kind.EXISTS bvs body
Instances For
Binding through Lean functions #
The body is a Lean function of the variables, one Term argument per variable, as for
Term.lambdaH: see Binder, which both share.
Universal quantification of a body written as a Lean function of its variables.
binders names each variable and gives its sort, in the order the function takes them:
Term.forallH [("x", int), ("y", int)] fun x y => do Term.equal (← Term.add x y) (← Term.add y x)
Equations
- Cvc.Untyped.Term.forallH binders body = do let __x ← Cvc.Untyped.Term.Binder.bindAll binders body match __x with | (bvs, body) => Cvc.Untyped.Term.mkQuant✝ cvc5.Kind.FORALL bvs body
Instances For
Existential quantification of a body written as a Lean function of its variables.
binders names each variable and gives its sort, in the order the function takes them.
Equations
- Cvc.Untyped.Term.existsH binders body = do let __x ← Cvc.Untyped.Term.Binder.bindAll binders body match __x with | (bvs, body) => Cvc.Untyped.Term.mkQuant✝ cvc5.Kind.EXISTS bvs body
Instances For
The view of a quantifier #
Written by hand, as the quantifiers are: a bound variable is not something a specification
describes. forall and exists are Lean keywords, hence the primes.
A quantified formula, taken apart one level, sort-erased.
- forall'
[Ω]
(vars : BVars)
(body : Term)
(patterns : Option Term)
: View.Quant
∀ x₁ … xₙ, body, with cvc5's instantiation patterns if it has any. - exists'
[Ω]
(vars : BVars)
(body : Term)
(patterns : Option Term)
: View.Quant
∃ x₁ … xₙ, body, with cvc5's instantiation patterns if it has any.
Instances For
Takes a term apart one level, if it is a quantified formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
smt! #
smt! ∀ (x y : s) (b : t), body and smt! ∃ … are Lean's own quantifier syntax, binders in
parentheses as fun takes them. A binder's sort is a Lean type (Int) or a Srt value (int).
The body extends as far right as it can, as in Lean, so a quantifier in argument position needs parentheses. Each variable is named as the writer named it, which is also the name cvc5 prints.
Universal quantification.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Existential quantification.
Equations
- One or more equations did not get rendered due to their size.