NanoProlog-0.1.3: Very small interpreter for a Prolog-like language

Safe HaskellSafe-Infered

Language.Prolog.NanoProlog.Lib

Synopsis

Documentation

data Result Source

Constructors

Done Env 
ApplyRules [(Rule, Result)] 

data Rule Source

Constructors

Term :<-: [Term] 

class Subst t whereSource

Methods

subst :: Env -> t -> tSource

Instances

class Taggable a whereSource

Methods

tag :: Int -> a -> aSource

Instances

data Term Source

Constructors

Var UpperCase 
Fun LowerCase [Term] 

emptyEnv :: Maybe (Map UpperCase t)Source

enumerateDepthFirst :: Proofs -> [String] -> Result -> [(Proofs, Env)]Source

show' :: Env -> StringSource

printEnv prints a single solution, showing only the variables that were introduced in the original goal

solve :: [Rule] -> Maybe Env -> Int -> [Term] -> ResultSource

startParse :: (ListLike s b, Show b) => P (Str b s LineColPos) a -> s -> (a, [Error LineColPos])Source

unify :: (Term, Term) -> Maybe Env -> Maybe EnvSource