Safe Haskell | None |
---|---|
Language | Haskell98 |
IsQuantified
is a subclass of IsPropositional
of formula
types that support existential and universal quantification.
- data Quant
- class (IsPropositional formula, IsVariable (VarOf formula)) => IsQuantified formula where
- for_all :: IsQuantified formula => VarOf formula -> formula -> formula
- (∀) :: IsQuantified formula => VarOf formula -> formula -> formula
- exists :: IsQuantified formula => VarOf formula -> formula -> formula
- (∃) :: IsQuantified formula => VarOf formula -> formula -> formula
- precedenceQuantified :: forall formula. IsQuantified formula => formula -> Precedence
- associativityQuantified :: forall formula. IsQuantified formula => formula -> Associativity
- prettyQuantified :: forall fof v. (IsQuantified fof, v ~ VarOf fof) => Side -> PrettyLevel -> Rational -> fof -> Doc
- showQuantified :: IsQuantified formula => Side -> Int -> formula -> ShowS
- zipQuantified :: IsQuantified formula => (Quant -> VarOf formula -> formula -> Quant -> VarOf formula -> formula -> Maybe r) -> (formula -> BinOp -> formula -> formula -> BinOp -> formula -> Maybe r) -> (formula -> formula -> Maybe r) -> (Bool -> Bool -> Maybe r) -> (AtomOf formula -> AtomOf formula -> Maybe r) -> formula -> formula -> Maybe r
- convertQuantified :: forall f1 f2. (IsQuantified f1, IsQuantified f2) => (AtomOf f1 -> AtomOf f2) -> (VarOf f1 -> VarOf f2) -> f1 -> f2
- onatomsQuantified :: IsQuantified formula => (AtomOf formula -> AtomOf formula) -> formula -> formula
- overatomsQuantified :: IsQuantified fof => (AtomOf fof -> r -> r) -> fof -> r -> r
- data QFormula v atom
Documentation
The two types of quantification
class (IsPropositional formula, IsVariable (VarOf formula)) => IsQuantified formula where Source
Class of quantified formulas.
quant :: Quant -> VarOf formula -> formula -> formula Source
foldQuantified :: (Quant -> VarOf formula -> formula -> r) -> (formula -> BinOp -> formula -> r) -> (formula -> r) -> (Bool -> r) -> (AtomOf formula -> r) -> formula -> r Source
(IsPropositional (QFormula v atom), IsVariable v, IsAtom atom) => IsQuantified (QFormula v atom) Source |
for_all :: IsQuantified formula => VarOf formula -> formula -> formula Source
(∀) :: IsQuantified formula => VarOf formula -> formula -> formula infixr 1 Source
∀ can't be a function when -XUnicodeSyntax is enabled.
exists :: IsQuantified formula => VarOf formula -> formula -> formula Source
(∃) :: IsQuantified formula => VarOf formula -> formula -> formula infixr 1 Source
precedenceQuantified :: forall formula. IsQuantified formula => formula -> Precedence Source
associativityQuantified :: forall formula. IsQuantified formula => formula -> Associativity Source
prettyQuantified :: forall fof v. (IsQuantified fof, v ~ VarOf fof) => Side -> PrettyLevel -> Rational -> fof -> Doc Source
Implementation of Pretty
for IsQuantified
types.
showQuantified :: IsQuantified formula => Side -> Int -> formula -> ShowS Source
Implementation of showsPrec
for IsQuantified
types.
zipQuantified :: IsQuantified formula => (Quant -> VarOf formula -> formula -> Quant -> VarOf formula -> formula -> Maybe r) -> (formula -> BinOp -> formula -> formula -> BinOp -> formula -> Maybe r) -> (formula -> formula -> Maybe r) -> (Bool -> Bool -> Maybe r) -> (AtomOf formula -> AtomOf formula -> Maybe r) -> formula -> formula -> Maybe r Source
Combine two formulas if they are similar.
convertQuantified :: forall f1 f2. (IsQuantified f1, IsQuantified f2) => (AtomOf f1 -> AtomOf f2) -> (VarOf f1 -> VarOf f2) -> f1 -> f2 Source
Convert any instance of IsQuantified to any other by specifying the result type.
onatomsQuantified :: IsQuantified formula => (AtomOf formula -> AtomOf formula) -> formula -> formula Source
overatomsQuantified :: IsQuantified fof => (AtomOf fof -> r -> r) -> fof -> r -> r Source
Concrete instance of a quantified formula type
F | |
T | |
Atom atom | |
Not (QFormula v atom) | |
And (QFormula v atom) (QFormula v atom) | |
Or (QFormula v atom) (QFormula v atom) | |
Imp (QFormula v atom) (QFormula v atom) | |
Iff (QFormula v atom) (QFormula v atom) | |
Forall v (QFormula v atom) | |
Exists v (QFormula v atom) |