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

Language.Prolog.NanoProlog.NanoProlog

Synopsis

Documentation

type Env = Map UpperCase TermSource

data Result Source

Constructors

Done Env 
ApplyRules [(Tag, Rule, Result)] 

data Rule Source

Constructors

Term :<-: [Term] 

class Subst t whereSource

Methods

subst :: Env -> t -> tSource

Instances

class Taggable a whereSource

Methods

tag :: Tag -> a -> aSource

Instances

data Term Source

Constructors

Var UpperCase 
Fun LowerCase [Term] 

emptyEnv :: Maybe (Map UpperCase t)Source

enumerateDepthFirst :: Proofs -> 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 -> [TaggedTerm] -> ResultSource

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