| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Prolog
Synopsis
- termSignature :: Term -> Maybe Signature
- resolve :: (Functor m, MonadError Error m, MonadTrace m) => Program -> [Goal] -> m [Unifier]
- resolveN :: (Functor m, MonadError Error m, MonadTrace m) => Int -> Program -> [Goal] -> m [Unifier]
- resolveN_ :: (Functor m, MonadError Error m, MonadGraphGen m, MonadTrace m) => Int -> Program -> [Goal] -> m [Unifier]
- resolveP :: forall (m :: Type -> Type). (Monad m, MonadError Error m, MonadGraphGen m, MonadTrace m) => Program -> [Goal] -> Producer Unifier m [Unifier]
- resolve_ :: (Functor m, MonadError Error m, MonadGraphGen m, MonadTrace m) => Program -> [Goal] -> m [Unifier]
- bottom :: ParsecT String () Identity Term
- clause :: ParsecT String () Identity ProgramClause
- consult :: FilePath -> IO (Either ParseError [ProgramClause])
- consultString :: String -> Either ParseError [ProgramClause]
- parseQuery :: String -> Either ParseError [Term]
- program :: ParsecT String () Identity [ProgramClause]
- term :: ParsecT String () Identity Term
- terms :: ParsecT String () Identity [Term]
- vname :: ParsecT String () Identity VariableName
- whitespace :: ParsecT String () Identity ()
- runQuery :: Maybe FilePath -> String -> IO [Unifier]
- runQuery' :: TraceMode -> Maybe FilePath -> String -> IO [Unifier]
- runQueryN :: Int -> Maybe FilePath -> String -> IO [Unifier]
- runQueryN' :: TraceMode -> Int -> Maybe FilePath -> String -> IO [Unifier]
- cut :: Term
- prettifyClause :: Clause -> String
- prettifyTerm :: Term -> String
- prettifyVariableName :: VariableName -> String
- rhs :: Clause -> [Term] -> [Goal]
- var :: String -> Term
- (+++) :: [Substitution] -> [Substitution] -> Unifier
- apply :: Unifier -> Term -> Term
- substitute :: (VariableName, Term) -> Term -> Term
- unify :: MonadFail m => Term -> Term -> m Unifier
- unifyWithOccursCheck :: MonadFail m => Term -> Term -> m Unifier
- data Signature = Signature Atom Int
- class Monad m => MonadGraphGen (m :: Type -> Type) where
- createConnections :: Branch -> [Branch] -> [Branch] -> m ()
- markSolution :: Unifier -> m ()
- markCutBranches :: Stack -> m ()
- class Monad m => MonadTrace (m :: Type -> Type) where
- runNoGraphT :: NoGraphT m a -> m a
- withTrace :: Trace m a -> m a
- data TraceMode
- type Atom = String
- data Clause
- = Clause {
- predicateName :: Atom
- predicateArgs :: [Term]
- rhs_ :: [Goal]
- | ClauseFn {
- predicateName :: Atom
- predicateArgs :: [Term]
- fn :: [Term] -> [Goal]
- = Clause {
- type Goal = Term
- type Program = [Clause]
- type ProgramClause = (Atom, [Term], [Goal])
- data Term
- data VariableName
- type Substitution = (VariableName, Term)
- type Unifier = [Substitution]
Documentation
resolve :: (Functor m, MonadError Error m, MonadTrace m) => Program -> [Goal] -> m [Unifier] Source #
resolveN :: (Functor m, MonadError Error m, MonadTrace m) => Int -> Program -> [Goal] -> m [Unifier] Source #
resolveN_ :: (Functor m, MonadError Error m, MonadGraphGen m, MonadTrace m) => Int -> Program -> [Goal] -> m [Unifier] Source #
resolveP :: forall (m :: Type -> Type). (Monad m, MonadError Error m, MonadGraphGen m, MonadTrace m) => Program -> [Goal] -> Producer Unifier m [Unifier] Source #
resolve_ :: (Functor m, MonadError Error m, MonadGraphGen m, MonadTrace m) => Program -> [Goal] -> m [Unifier] Source #
consult :: FilePath -> IO (Either ParseError [ProgramClause]) Source #
consultString :: String -> Either ParseError [ProgramClause] Source #
parseQuery :: String -> Either ParseError [Term] Source #
prettifyClause :: Clause -> String Source #
prettifyTerm :: Term -> String Source #
(+++) :: [Substitution] -> [Substitution] -> Unifier Source #
substitute :: (VariableName, Term) -> Term -> Term Source #
Instances
| Data Signature Source # | |||||
Defined in Database Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Signature -> c Signature # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Signature # toConstr :: Signature -> Constr # dataTypeOf :: Signature -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Signature) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Signature) # gmapT :: (forall b. Data b => b -> b) -> Signature -> Signature # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Signature -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Signature -> r # gmapQ :: (forall d. Data d => d -> u) -> Signature -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Signature -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Signature -> m Signature # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Signature -> m Signature # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Signature -> m Signature # | |||||
| Generic Signature Source # | |||||
Defined in Database Associated Types
| |||||
| Show Signature Source # | |||||
| Eq Signature Source # | |||||
| Ord Signature Source # | |||||
| type Rep Signature Source # | |||||
Defined in Database type Rep Signature = D1 ('MetaData "Signature" "Database" "prolog-0.4.2-Ko3tEI33RsH2ztVSUr9Jea" 'False) (C1 ('MetaCons "Signature" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Atom) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) | |||||
class Monad m => MonadGraphGen (m :: Type -> Type) where Source #
Methods
createConnections :: Branch -> [Branch] -> [Branch] -> m () Source #
markSolution :: Unifier -> m () Source #
markCutBranches :: Stack -> m () Source #
Instances
| (Monad (t m), MonadGraphGen m, MonadTrans t) => MonadGraphGen (t m) Source # | |
Defined in Interpreter Methods createConnections :: Branch -> [Branch] -> [Branch] -> t m () Source # markSolution :: Unifier -> t m () Source # markCutBranches :: Stack -> t m () Source # | |
class Monad m => MonadTrace (m :: Type -> Type) where Source #
Instances
| MonadTrace IO Source # | |
| MonadTrace (Either err) Source # | |
| (Monad (t m), MonadTrace m, MonadTrans t) => MonadTrace (t m) Source # | |
Defined in Interpreter | |
runNoGraphT :: NoGraphT m a -> m a Source #
Constructors
| Clause | |
Fields
| |
| ClauseFn | |
Fields
| |
Instances
type ProgramClause = (Atom, [Term], [Goal]) Source #
An abbreviation for a clause defined in a program
Instances
| Data Term Source # | |||||
Defined in Syntax Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Term -> c Term # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Term # dataTypeOf :: Term -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Term) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Term) # gmapT :: (forall b. Data b => b -> b) -> Term -> Term # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Term -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Term -> r # gmapQ :: (forall d. Data d => d -> u) -> Term -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Term -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Term -> m Term # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Term -> m Term # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Term -> m Term # | |||||
| IsString Term Source # | |||||
Defined in IsString Methods fromString :: String -> Term # | |||||
| Generic Term Source # | |||||
Defined in Syntax Associated Types
| |||||
| Show Term Source # | |||||
| Eq Term Source # | |||||
| Ord Term Source # | |||||
| Lift Term Source # | |||||
| Lift ([Term] -> [Goal]) Source # | |||||
| type Rep Term Source # | |||||
Defined in Syntax type Rep Term = D1 ('MetaData "Term" "Syntax" "prolog-0.4.2-Ko3tEI33RsH2ztVSUr9Jea" 'False) (C1 ('MetaCons "Struct" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Atom) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Term])) :+: (C1 ('MetaCons "Var" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VariableName)) :+: C1 ('MetaCons "Cut" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))) | |||||
data VariableName Source #
Instances
| Data VariableName Source # | |||||
Defined in Syntax Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> VariableName -> c VariableName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c VariableName # toConstr :: VariableName -> Constr # dataTypeOf :: VariableName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c VariableName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c VariableName) # gmapT :: (forall b. Data b => b -> b) -> VariableName -> VariableName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> VariableName -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> VariableName -> r # gmapQ :: (forall d. Data d => d -> u) -> VariableName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> VariableName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> VariableName -> m VariableName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> VariableName -> m VariableName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> VariableName -> m VariableName # | |||||
| IsString VariableName Source # | |||||
Defined in IsString Methods fromString :: String -> VariableName # | |||||
| Generic VariableName Source # | |||||
Defined in Syntax Associated Types
| |||||
| Show VariableName Source # | |||||
Defined in Syntax Methods showsPrec :: Int -> VariableName -> ShowS # show :: VariableName -> String # showList :: [VariableName] -> ShowS # | |||||
| Eq VariableName Source # | |||||
Defined in Syntax | |||||
| Ord VariableName Source # | |||||
Defined in Syntax Methods compare :: VariableName -> VariableName -> Ordering # (<) :: VariableName -> VariableName -> Bool # (<=) :: VariableName -> VariableName -> Bool # (>) :: VariableName -> VariableName -> Bool # (>=) :: VariableName -> VariableName -> Bool # max :: VariableName -> VariableName -> VariableName # min :: VariableName -> VariableName -> VariableName # | |||||
| Lift VariableName Source # | |||||
Defined in Syntax Methods lift :: Quote m => VariableName -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => VariableName -> Code m VariableName # | |||||
| type Rep VariableName Source # | |||||
Defined in Syntax type Rep VariableName = D1 ('MetaData "VariableName" "Syntax" "prolog-0.4.2-Ko3tEI33RsH2ztVSUr9Jea" 'False) (C1 ('MetaCons "VariableName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "Wildcard" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)))) | |||||
type Substitution = (VariableName, Term) Source #
type Unifier = [Substitution] Source #