Portability | portable (depends on ghc) |
---|---|
Stability | provisional |
Maintainer | bastiaan.heeren@ou.nl |
Safe Haskell | None |
A prefix encodes a sequence of steps already performed (a so-called trace), and allows to continue the derivation at that particular point.
- type Prefix = ParseState LabelInfo
- emptyPrefix :: LabeledStrategy a -> a -> Prefix a
- makePrefix :: Monad m => Path -> LabeledStrategy a -> a -> m (Prefix a)
- showPrefix :: Prefix a -> String
- prefixToSteps :: Prefix a -> [Step LabelInfo a]
- prefixTree :: a -> Prefix a -> DerivationTree (Prefix a) a
- stepsToRules :: [Step l a] -> [Rule a]
- lastStepInPrefix :: Prefix a -> Maybe (Step LabelInfo a)
- activeLabels :: Prefix a -> [LabelInfo]
- searchModePrefix :: (Step LabelInfo a -> Bool) -> (Step LabelInfo a -> Step LabelInfo a -> Bool) -> Prefix a -> Prefix a
Documentation
type Prefix = ParseState LabelInfoSource
Abstract data type for a (labeled) strategy with a prefix (a sequence of
executed rules). A prefix is still aware of the labels that appear in the
strategy. A prefix is encoded as a list of integers (and can be reconstructed
from such a list: see makePrefix
). The list is stored in reversed order.
emptyPrefix :: LabeledStrategy a -> a -> Prefix aSource
Construct the empty prefix for a labeled strategy
makePrefix :: Monad m => Path -> LabeledStrategy a -> a -> m (Prefix a)Source
Construct a prefix for a given list of integers and a labeled strategy.
showPrefix :: Prefix a -> StringSource
prefixToSteps :: Prefix a -> [Step LabelInfo a]Source
prefixTree :: a -> Prefix a -> DerivationTree (Prefix a) aSource
Create a derivation tree with a prefix as annotation.
stepsToRules :: [Step l a] -> [Rule a]Source
Retrieves the rules from a list of steps
lastStepInPrefix :: Prefix a -> Maybe (Step LabelInfo a)Source
Returns the last rule of a prefix (if such a rule exists)
activeLabels :: Prefix a -> [LabelInfo]Source
Calculate the active labels