ideas-1.1: Feedback services for intelligent tutoring systems

Portabilityportable (depends on ghc)
Stabilityprovisional
Maintainerbastiaan.heeren@ou.nl
Safe HaskellNone

Ideas.Common.Strategy.Prefix

Description

A prefix encodes a sequence of steps already performed (a so-called trace), and allows to continue the derivation at that particular point.

Synopsis

Documentation

data Prefix a Source

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.

Instances

Eq (Prefix a) 
Show (Prefix a) 

emptyPrefix :: LabeledStrategy a -> Prefix aSource

Construct the empty prefix for a labeled strategy

makePrefix :: Monad m => [Int] -> LabeledStrategy a -> m (Prefix a)Source

Construct a prefix for a given list of integers and a labeled strategy.

prefixTree :: Bool -> Prefix a -> 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