Kulitta-2.2.1: Library for automated composition and musical learning

Kulitta.PTGG

data Term a b Source #

Constructors

Defined in Kulitta.PTGG

Methods

(==) :: Term a b -> Term a b -> Bool #

(/=) :: Term a b -> Term a b -> Bool #

showsPrec :: Int -> Term a b -> ShowS #

show :: Term a b -> String #

showList :: [Term a b] -> ShowS #

type Sentence a b = [Term a b] Source #

type Prob = Double Source #

data Rule a b Source #

type RuleFun a b = b -> Sentence a b Source #

update :: (Eq a, Eq b) => [Rule a b] -> (StdGen, Sentence a b) -> (StdGen, Sentence a b) Source #

applyRule :: Eq a => [Rule a b] -> StdGen -> (a, b) -> (StdGen, Sentence a b) Source #

gen :: (Eq a, Eq b) => [Rule a b] -> (StdGen, Sentence a b) -> [(StdGen, Sentence a b)] Source #

expand :: [(String, Sentence a b)] -> Sentence a b -> Sentence a b Source #

tMap :: ((a, b) -> (c, d)) -> Sentence a b -> Sentence c d Source #

toPairs :: Sentence a b -> [(a, b)] Source #

updateProbs :: [Rule a b] -> [Prob] -> [Rule a b] Source #

lhs :: Rule a b -> a Source #

prob :: Rule a b -> Prob Source #

rfun :: Rule a b -> RuleFun a b Source #

normalize :: Eq a => [Rule a b] -> [Rule a b] Source #