Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data FKind
- data Label a l
- newtype ElemBase a = ElemBase {}
- type ReactionList a = RList (ElemBase a) (CtrlSet a)
- data LFormula :: FKind -> * -> * -> * where
- ppLFormula :: (a -> String) -> LFormula k a l -> String
- elemBase :: Ord a => LFormula k a l -> ElemBase a
- label :: LFormula k a l -> Label a l
- frmlHetEq :: (Eq a, Eq l) => LFormula k1 a l -> LFormula k2 a l -> Bool
- frmlHetOrd :: (Ord a, Ord l) => LFormula k1 a l -> LFormula k2 a l -> Ordering
- deepHetComp :: (Ord a, Ord l) => LFormula k1 a l -> LFormula k2 a l -> Ordering
- data LAxiom a l = LAx (BFormula a l) (ReactionList a) (BFormula a l) l
- axLabel :: LAxiom a l -> l
- axToFormula :: Ord a => LAxiom a l -> LFormula KImpl a l
- ppLAxiom :: Ord a => (a -> String) -> LAxiom a l -> String
- data Opaque a l = O (LFormula k a l)
- withOpaque :: (forall k. LFormula k a l -> b) -> Opaque a l -> b
- oConj :: Opaque a l -> Opaque a l -> l -> LFormula KConj a l
- oImpl :: Opaque a l -> ElemBase a -> ReactionList a -> Opaque a l -> l -> LFormula KImpl a l
- data BFormula a l
- bAtom :: a -> BFormula a l
- bConj :: l -> BFormula a l -> BFormula a l -> BFormula a l
- bfToFormula :: BFormula a l -> Opaque a l
- bfToAtoms :: BFormula a l -> NonEmpty a
- maybeBFormula :: LFormula k a l -> Maybe (BFormula a l)
Documentation
Type of formula labels. Note that logical atoms are their own labels.
Instances
Eq a => Eq (ElemBase a) Source # | |
Ord a => Ord (ElemBase a) Source # | |
Show a => Show (ElemBase a) Source # | |
Ord a => Semigroup (ElemBase a) Source # | |
Ord a => Monoid (ElemBase a) Source # | |
Labelled formulas
data LFormula :: FKind -> * -> * -> * where Source #
Type of labelled formulas, indexed by a formula kind and parameterized by the type of the labels and of the logical atoms.
Atom :: a -> LFormula KAtom a l | |
Conj :: LFormula k1 a l -> LFormula k2 a l -> l -> LFormula KConj a l | |
Impl :: LFormula k1 a l -> ElemBase a -> ReactionList a -> LFormula k2 a l -> l -> LFormula KImpl a l |
Instances
Functor (LFormula k a) Source # | |
Foldable (LFormula k a) Source # | |
Defined in Zsyntax.Labelled.Formula fold :: Monoid m => LFormula k a m -> m # foldMap :: Monoid m => (a0 -> m) -> LFormula k a a0 -> m # foldr :: (a0 -> b -> b) -> b -> LFormula k a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> LFormula k a a0 -> b # foldl :: (b -> a0 -> b) -> b -> LFormula k a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> LFormula k a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> LFormula k a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> LFormula k a a0 -> a0 # toList :: LFormula k a a0 -> [a0] # null :: LFormula k a a0 -> Bool # length :: LFormula k a a0 -> Int # elem :: Eq a0 => a0 -> LFormula k a a0 -> Bool # maximum :: Ord a0 => LFormula k a a0 -> a0 # minimum :: Ord a0 => LFormula k a a0 -> a0 # | |
Traversable (LFormula k a) Source # | |
Defined in Zsyntax.Labelled.Formula | |
(Show a, Show l) => Show (LFormula k a l) Source # | |
ppLFormula :: (a -> String) -> LFormula k a l -> String Source #
Pretty-print labelled formulas, given a way to pretty-print its atoms.
Note that this function ignores labels, for which one should use the Show
instance.
elemBase :: Ord a => LFormula k a l -> ElemBase a Source #
Returns the elementary base of a labelled formula.
frmlHetEq :: (Eq a, Eq l) => LFormula k1 a l -> LFormula k2 a l -> Bool Source #
Heterogeneous equality test between labelled formulas.
This function just compares the formulas' labels for equality, under the assumption that labels have been assigned in a sensible way.
frmlHetOrd :: (Ord a, Ord l) => LFormula k1 a l -> LFormula k2 a l -> Ordering Source #
Heterogeneous comparison between labelled formulas.
This function just compares the formulas' labels, under the assumption that labels have been assigned in a sensible way.
deepHetComp :: (Ord a, Ord l) => LFormula k1 a l -> LFormula k2 a l -> Ordering Source #
Returns the result of a deep heterogeneous comparison between two labelled formulas.
Comparison is "deep" in the sense that is considers the entire recursive
structure of formulas. This is unlike frmlHetOrd
, which only compares
labels.
Labelled axioms
LAx (BFormula a l) (ReactionList a) (BFormula a l) l |
Instances
Functor (LAxiom a) Source # | |
Foldable (LAxiom a) Source # | |
Defined in Zsyntax.Labelled.Formula fold :: Monoid m => LAxiom a m -> m # foldMap :: Monoid m => (a0 -> m) -> LAxiom a a0 -> m # foldr :: (a0 -> b -> b) -> b -> LAxiom a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> LAxiom a a0 -> b # foldl :: (b -> a0 -> b) -> b -> LAxiom a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> LAxiom a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> LAxiom a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> LAxiom a a0 -> a0 # toList :: LAxiom a a0 -> [a0] # length :: LAxiom a a0 -> Int # elem :: Eq a0 => a0 -> LAxiom a a0 -> Bool # maximum :: Ord a0 => LAxiom a a0 -> a0 # minimum :: Ord a0 => LAxiom a a0 -> a0 # | |
Traversable (LAxiom a) Source # | |
Defined in Zsyntax.Labelled.Formula | |
Eq l => Eq (LAxiom a l) Source # | |
Ord l => Ord (LAxiom a l) Source # | |
(Show a, Show l) => Show (LAxiom a l) Source # | |
axToFormula :: Ord a => LAxiom a l -> LFormula KImpl a l Source #
Converts a labelled axiom to a labelled formula.
ppLAxiom :: Ord a => (a -> String) -> LAxiom a l -> String Source #
Pretty-prints a labelled axiom, given a way to pretty-print its atoms.
Note that this function ignores labels, for which one should rely on the
Show
instance.
Opaque formulas
Type of opaque formulas, that is, those for which we do not care about their formula kind.
Instances
(Eq l, Eq a) => Eq (Opaque a l) Source # | |
(Ord l, Ord a) => Ord (Opaque a l) Source # | |
(Show a, Show l) => Show (Opaque a l) Source # | |
withOpaque :: (forall k. LFormula k a l -> b) -> Opaque a l -> b Source #
oConj :: Opaque a l -> Opaque a l -> l -> LFormula KConj a l Source #
Constructs the conjunction of two opaque formulas. The result is a provably conjunctive labelled formula.
oImpl :: Opaque a l -> ElemBase a -> ReactionList a -> Opaque a l -> l -> LFormula KImpl a l Source #
Constructs the Zsyntax conditional (aka linear implication) between two opaque formulas, whose reaction is described by a given elementary base and reaction list. The result is a provably implicational labelled formula.
Basic formulas
Type of basic formulas. A basic formula is one composed of conjunctions of atoms.
Instances
Functor (BFormula a) Source # | |
Foldable (BFormula a) Source # | |
Defined in Zsyntax.Labelled.Formula fold :: Monoid m => BFormula a m -> m # foldMap :: Monoid m => (a0 -> m) -> BFormula a a0 -> m # foldr :: (a0 -> b -> b) -> b -> BFormula a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> BFormula a a0 -> b # foldl :: (b -> a0 -> b) -> b -> BFormula a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> BFormula a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> BFormula a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> BFormula a a0 -> a0 # toList :: BFormula a a0 -> [a0] # null :: BFormula a a0 -> Bool # length :: BFormula a a0 -> Int # elem :: Eq a0 => a0 -> BFormula a a0 -> Bool # maximum :: Ord a0 => BFormula a a0 -> a0 # minimum :: Ord a0 => BFormula a a0 -> a0 # | |
Traversable (BFormula a) Source # | |
Defined in Zsyntax.Labelled.Formula | |
(Show a, Show l) => Show (BFormula a l) Source # | |
bConj :: l -> BFormula a l -> BFormula a l -> BFormula a l Source #
Constructs the conjunction of two basic formulas, with a given label.
bfToFormula :: BFormula a l -> Opaque a l Source #
Returns the labelled formula corresponding to a given basic formula.
Note that the result formula is opaque, since it could be an atom as well as a conjunction, and thus has no determined index.