Advise-me-0.1: Assessment services for the Advise-Me project

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

Recognize.Model.Connectives

Contents

Description

This module defines functions and operators for constructing and combining constraints.

Synopsis

Constructing constraints

success :: Monad m => Constraint m a Source #

Constraint with an always succesful predicate

unknown :: Monad m => Constraint m a Source #

Constraint whose predicate is always unknown

failure :: Monad m => Constraint m a Source #

Constraint whose predicate is always failure

exists1 :: Attribute -> Constraint EvBuilder [Attribute] Source #

If the attribute is present the constraint holds

otherwise we do not know

exists :: [Attribute] -> Constraint EvBuilder [Attribute] Source #

If all attributes are present the constraint holds

otherwise we do not know

existsF1 :: Attribute -> Constraint EvBuilder [Attribute] Source #

If the attribute is present the constraint holds

otherwise it does not

existsF :: [Attribute] -> Constraint EvBuilder [Attribute] Source #

If all attributes are present the constraint holds

otherwise it does not

implication Source #

Arguments

:: [Attribute]

Hypotheses

-> [Attribute]

Conclusions

-> Constraint EvBuilder [Attribute] 

If all hypotheses are present and all conclusions are present then the constraint holds

If all hypotheses are present, but not all conclusions are present then the constraint does not hold

If not all hypotheses are present then we do not know

Combinators

negateConstraint :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] Source #

Negate the results of the predicate within a constraint.

(<?>>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] Source #

If the first constraint is unknown then we return the result of the second constraint

(<<?>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] Source #

If the second constraint is unknown then we return the result of the first constraint

(==>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] Source #

Implication over constraints

If the first constraint holds then the result of this operation is equal to that of the second constraint

otherwise we do not know whether this constraint holds

(<~>) :: Expr -> Expr -> Constraint EvBuilder a Source #

Equality constraint between two expressions Does not consume any input