ideas-1.6: Feedback services for intelligent tutoring systems

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

Ideas.Common.Rule.Abstract

Contents

Description

A rule is just a transformation with some meta-information, such as a name (which should be unique) and properties such as "buggy" or "minor". Rules can be lifted with a view using the LiftView type class.

Synopsis

Rule data type and accessors

data Rule a Source #

Abstract data type for representing rules

Instances

Apply Rule Source # 

Methods

applyAll :: Rule a -> a -> [a] Source #

LiftView Rule Source # 

Methods

liftView :: View a b -> Rule b -> Rule a Source #

liftViewIn :: View a (b, c) -> Rule b -> Rule a Source #

Recognizable Rule Source # 

Methods

recognizer :: Rule a -> Recognizer a Source #

recognizeAll :: Rule a -> a -> a -> [Environment] Source #

recognize :: Rule a -> a -> a -> Maybe Environment Source #

recognizeTrans :: Rule a -> Trans (a, a) () Source #

IsStrategy Rule Source # 

Methods

toStrategy :: Rule a -> Strategy a Source #

Eq (Rule a) Source # 

Methods

(==) :: Rule a -> Rule a -> Bool #

(/=) :: Rule a -> Rule a -> Bool #

Ord (Rule a) Source # 

Methods

compare :: Rule a -> Rule a -> Ordering #

(<) :: Rule a -> Rule a -> Bool #

(<=) :: Rule a -> Rule a -> Bool #

(>) :: Rule a -> Rule a -> Bool #

(>=) :: Rule a -> Rule a -> Bool #

max :: Rule a -> Rule a -> Rule a #

min :: Rule a -> Rule a -> Rule a #

Show (Rule a) Source # 

Methods

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

show :: Rule a -> String #

showList :: [Rule a] -> ShowS #

Minor (Rule a) Source # 

Methods

minor :: Rule a -> Rule a Source #

setMinor :: Bool -> Rule a -> Rule a Source #

isMinor :: Rule a -> Bool Source #

isMajor :: Rule a -> Bool Source #

Buggy (Rule a) Source # 

Methods

buggy :: Rule a -> Rule a Source #

setBuggy :: Bool -> Rule a -> Rule a Source #

isBuggy :: Rule a -> Bool Source #

HasId (Rule a) Source # 

Methods

getId :: Rule a -> Id Source #

changeId :: (Id -> Id) -> Rule a -> Rule a Source #

HasRefs (Rule a) Source # 

Methods

getRefs :: Rule a -> [Some Ref] Source #

allRefs :: Rule a -> [Some Ref] Source #

getRefIds :: Rule a -> [Id] Source #

LabelSymbol (Rule a) Source # 

Methods

isEnterSymbol :: Rule a -> Bool Source #

AtomicSymbol (Rule a) Source # 

Constructor functions

makeRule :: (IsId n, MakeTrans f) => n -> (a -> f a) -> Rule a Source #

ruleMaybe :: IsId n => n -> (a -> Maybe a) -> Rule a Source #

ruleList :: IsId n => n -> (a -> [a]) -> Rule a Source #

buggyRule :: (IsId n, MakeTrans f) => n -> (a -> f a) -> Rule a Source #

minorRule :: (IsId n, MakeTrans f) => n -> (a -> f a) -> Rule a Source #

rewriteRule :: (IsId n, RuleBuilder f a) => n -> f -> Rule a Source #

rewriteRules :: (IsId n, RuleBuilder f a) => n -> [f] -> Rule a Source #

Special minor rules

idRule :: IsId n => n -> Rule a Source #

A special (minor) rule that always returns the identity

checkRule :: IsId n => n -> (a -> Bool) -> Rule a Source #

A special (minor) rule that checks a predicate (and returns the identity if the predicate holds)

emptyRule :: IsId n => n -> Rule a Source #

A special (minor) rule that is never applicable (i.e., this rule always fails)

Rule properties

siblingOf :: HasId b => b -> Rule a -> Rule a Source #

doAfter :: (a -> a) -> Rule a -> Rule a Source #

Perform the function after the rule has been fired

Recognizer

addRecognizerBool :: (a -> a -> Bool) -> Rule a -> Rule a Source #

addTransRecognizer :: (a -> a -> Bool) -> Rule a -> Rule a Source #