-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Very small interpreter for a Prolog-like language -- -- This package was developed to demonstrate the ideas behind the Prolog -- language. It contains a very small interpreter -- (Language.Prolog.Nanoprolog) which can be run on its own. It -- reads a file with definitions, and then prompts for a goal. All -- possibe solutions are printed, preceded by a tree showing which rules -- were applied in which order. @package NanoProlog @version 0.1.2 module Language.Prolog.NanoProlog.Lib type LowerCase = String data Result None :: Result Done :: Env -> Result ApplyRules :: [(Rule, Result)] -> Result data Rule (:<-:) :: Term -> [Term] -> Rule class Subst t subst :: Subst t => Env -> t -> t class Taggable a tag :: Taggable a => Int -> a -> a data Term Var :: UpperCase -> Term Fun :: LowerCase -> [Term] -> Term emptyEnv :: Maybe (Map UpperCase t) enumerateDepthFirst :: [(String, Rule)] -> [String] -> Result -> [([(String, Rule)], Env)] pFun :: Parser Term pRule :: Parser Rule pTerm :: Parser Term -- | printEnv prints a single solution, showing only the variables -- that were introduced in the original goal show' :: Env -> [Char] solve :: [Rule] -> Maybe Env -> Int -> [Term] -> Result startParse :: (ListLike s b, Show b) => P (Str b s LineColPos) a -> s -> (a, [Error LineColPos]) unify :: (Term, Term) -> Maybe Env -> Maybe Env instance Eq Term instance Ord Term instance Eq Rule instance Show Rule instance Show Term instance Subst Rule instance Subst Term instance Subst a => Subst [a] instance Taggable a => Taggable [a] instance Taggable Rule instance Taggable Term