discokitty-0.1.0: DisCoCat implementation.

LicenseGPL-3
Safe HaskellSafe
LanguageHaskell2010

Discokitty

Description

This module exports all basic modules of the Discokitty library. Please note that models and examples should be imported separately.

Synopsis

Documentation

class Dim a where Source #

Methods

dim :: a -> Int Source #

In the meaning space, states can have a given number of output wires. This function takes an state and should output the number of output wires it has.

Instances
Dim UniverseN Source # 
Instance details

Defined in Discokitty.Examples.LesJustesUniverse

Methods

dim :: UniverseN -> Int Source #

Dim (Words (Rel u)) Source # 
Instance details

Defined in Discokitty.Models.Rel

Methods

dim :: Words (Rel u) -> Int Source #

Dim (Rel u) Source # 
Instance details

Defined in Discokitty.Models.Rel

Methods

dim :: Rel u -> Int Source #

Dim (Vectorspace u m) Source # 
Instance details

Defined in Discokitty.Models.Vectorspaces

Methods

dim :: Vectorspace u m -> Int Source #

class HasCups m where Source #

Methods

cup :: Int -> m -> m -> m Source #

Given an integer, performs that number of cups between the two meaning spaces. In a monoidal category, this should be the composition of the tensor product of two states with a certain number of cups.

cunit :: m Source #

Neutral element for the cup operation. This could be given by the identity morphism (state).

Instances
Ord u => HasCups (Rel u) Source # 
Instance details

Defined in Discokitty.Models.Rel

Methods

cup :: Int -> Rel u -> Rel u -> Rel u Source #

cunit :: Rel u Source #

(Ord u, Eq u, Semiring m) => HasCups (Vectorspace u m) Source # 
Instance details

Defined in Discokitty.Models.Vectorspaces

Methods

cup :: Int -> Vectorspace u m -> Vectorspace u m -> Vectorspace u m Source #

cunit :: Vectorspace u m Source #

data Type Source #

Lambek basic grammatical types.

Constructors

N 
S 
L Type 
R Type 
Instances
Eq Type Source # 
Instance details

Defined in Discokitty.Lambek

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Ord Type Source # 
Instance details

Defined in Discokitty.Lambek

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

(<=) :: Type -> Type -> Bool #

(>) :: Type -> Type -> Bool #

(>=) :: Type -> Type -> Bool #

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

Show Type Source # 
Instance details

Defined in Discokitty.Lambek

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

type Lambek = [Type] Source #

A Lambek pregroup type.

agreeOn :: Int -> Lambek -> Lambek -> Bool Source #

Checks if two Lambek types can be reduced a given number of steps.

data Words m Source #

A word is given by a meaning and a grammatical type. The Words type is parameterized over the meaning type.

Constructors

Words 

Fields

Instances
Show m => Show (Words m) Source # 
Instance details

Defined in Discokitty.Words

Methods

showsPrec :: Int -> Words m -> ShowS #

show :: Words m -> String #

showList :: [Words m] -> ShowS #

Dim (Words (Rel u)) Source # 
Instance details

Defined in Discokitty.Models.Rel

Methods

dim :: Words (Rel u) -> Int Source #

sentence :: HasCups m => [Words m] -> [Words m] Source #

Concatenates a list of words outputting all possible grammatical reductions.

concatenate :: HasCups m => Words m -> Words m -> [Words m] Source #

emptyWord :: HasCups m => Words m Source #

Empty word. Unit for concatenation of words.

(@@@) :: [Words m] -> Lambek -> [Words m] Source #

Filters a list of words by grammatical type.