monadiccp-0.6.1: Constraint Programming

Control.CP.Herbrand.Herbrand

Description

This module provides a Herbrand solver.

The type of terms is parameterized by the HTerm type class.

Synopsis

Documentation

class Ord (VarId t) => HTerm t whereSource

Herbrand terms

Associated Types

type VarId t :: *Source

data VarSupply t :: *Source

Methods

varSupply :: VarSupply tSource

supplyVar :: VarSupply t -> (t, VarSupply t)Source

mkVar :: VarId t -> tSource

isVar :: t -> Maybe (VarId t)Source

children :: t -> ([t], [t] -> t)Source

nonvar_unify :: MonadState (HState t m) m => t -> t -> m BoolSource

Instances

data Herbrand t a Source

Herbrand monad

Constructors

Herbrand 

Fields

unH :: State (HState t (Herbrand t)) a
 

Instances

Monad (Herbrand t) 
Functor (Herbrand t) 
Applicative (Herbrand t) 
HTerm t => Solver (Herbrand t)

Solver instance

HTerm t => Term (Herbrand t) t 
MonadState (HState t (Herbrand t)) (Herbrand t) 

unify :: (HTerm t, MonadState (HState t m) m) => t -> t -> m BoolSource

unify two arbitrary terms

shallow_normalize :: (HTerm t, MonadState (HState t m) m) => t -> m tSource

registerAction :: (HTerm t, MonadState (HState t m) m) => t -> m Bool -> m ()Source

data HState t m Source

Instances

data Unify t Source

addH :: (HTerm t, MonadState (HState t m) m) => Unify t -> m BoolSource

newvarH :: (HTerm t, MonadState (HState t m) m) => m tSource