Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- data Term
- data Var
- type Neq = (Term, Term)
- (===) :: Term -> Term -> Predicate
- (=/=) :: Term -> Term -> Predicate
- fresh :: (Term -> Predicate) -> Predicate
- conj :: Predicate -> Predicate -> Predicate
- disconj :: Predicate -> Predicate -> Predicate
- data Predicate
- failure :: Predicate
- success :: Predicate
- currentGoal :: Term
- run :: (Term -> Predicate) -> [(Term, [Neq])]
Documentation
The terms of our logical language.
The abstract type of variables. As a consumer you should never feel the urge to manipulate these directly.
(===) :: Term -> Term -> Predicate Source
Equating two terms will attempt to unify them and backtrack if this is impossible.
(=/=) :: Term -> Term -> Predicate Source
The opposite of unification. If any future unification would cause these two terms to become equal we'll backtrack.
fresh :: (Term -> Predicate) -> Predicate Source
Generate a fresh (not rigid) term to use for our program.
conj :: Predicate -> Predicate -> Predicate Source
Conjunction. This will return solutions that satsify both the first and second predicate.
disconj :: Predicate -> Predicate -> Predicate Source
Disjunction. This will return solutions that satisfy either the first predicate or the second.
The Tigger of predicates! always passes. This isn't very useful
on it's own, but is helpful when building up new combinators. This
is also an identity for conj
.
The goal that this logic program is trying to create. This is occasionally useful when we're doing generating programs.