ideas-1.6: Feedback services for intelligent tutoring systems
Portabilityportable (depends on ghc)
Safe HaskellNone




Basic machinery for fully executing a strategy expression, or only partially. Partial execution results in a prefix that keeps the current locations in the strategy (a list of Paths) for continuing the execution later on. A path can be used to reconstruct the sequence of steps already performed (a so-called trace). Prefixes can be merged with the Monoid operation.



data Prefix a Source #


Show (Prefix a) Source # 


showsPrec :: Int -> Prefix a -> ShowS #

show :: Prefix a -> String #

showList :: [Prefix a] -> ShowS #

Monoid (Prefix a) Source # 


mempty :: Prefix a #

mappend :: Prefix a -> Prefix a -> Prefix a #

mconcat :: [Prefix a] -> Prefix a #

Firsts (Prefix a) Source # 

Associated Types

type Elem (Prefix a) :: * Source #


ready :: Prefix a -> Bool Source #

firsts :: Prefix a -> [(Elem (Prefix a), Prefix a)] Source #

type Elem (Prefix a) Source # 
type Elem (Prefix a) = (Rule a, a, Environment)

noPrefix :: Prefix a Source #

The error prefix (i.e., without a location in the strategy).

makePrefix :: Process (Leaf a) -> a -> Prefix a Source #

Make a prefix from a core strategy and a start term.

firstsOrdered :: (Rule a -> Rule a -> Ordering) -> Prefix a -> [((Rule a, a, Environment), Prefix a)] Source #

replayProcess :: Path -> Process (Leaf a) -> ([Rule a], a -> Prefix a) Source #

Construct a prefix by replaying a path in a core strategy: the third argument is the current term.

majorPrefix :: Prefix a -> Prefix a Source #

Transforms the prefix such that only major steps are kept in the remaining strategy.

searchModePrefix :: Prefix a -> Prefix a Source #

The searchModePrefix transformation changes the process in such a way that all intermediate states can only be reached by one path. A prerequisite is that symbols are unique (or only used once).

prefixPaths :: Prefix a -> [Path] Source #

Returns the current Path.


data Path Source #

A path encodes a location in a strategy. Paths are represented as a list of integers and terms (the latter act as input for the dynamic strategies).


Eq Path Source # 


(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

Show Path Source # 


showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

emptyPath :: Path Source #

The empty path.