liboleg-2010.1.10.0: An evolving collection of Oleg Kiselyov's Haskell modules

Language.Symantics1

Description

This is the Haskell version of symantics1.ml, for comparison ACG with a more expressive semantic lexicon that includes multi-prompt delimited continuations and the notion of evaluation. Types are considered as a mere approximation rather than the complete specification of grammatical composition.

Synopsis

Documentation

data N Source

Abstract signature, which defines base types, constants and their types

data NP Source

data S Source

data SM Source

type family I lab btyp Source

An interpretation of the base type btyp in the signature labeled by lab

class Abstract c whereSource

Methods

john :: c (I c NP)Source

bill :: c (I c NP)Source

man :: c (I c N)Source

woman :: c (I c N)Source

see :: c (I c NP) -> c (I c NP) -> c (I c S)Source

love :: c (I c NP) -> c (I c NP) -> c (I c S)Source

every :: c (I c N) -> c (I c NP)Source

some :: c (I c N) -> c (I c NP)Source

dot :: c (I c S) -> c (I c SM)Source

Instances

newtype LString a Source

Example from Sec 4.3 of the ESSLLI Advanced ACG course.

An interpretation of the abstract signature as the surface form: strings

Constructors

LString a 

Instances

data E Source

Semantic forms

Constructors

Ind String 

Instances

data T Source

Constructors

Man E 
Woman E 
See E E 
Love E E 
And T T 
Imply T T 
Exists Varname T 
Forall Varname T 

Instances

data QuantOrder Source

The order of quantification

Constructors

Uni_over_Exi 
Exi_over_Uni 

data SemEnv r Source

Constructors

SemEnv 

Fields

puni :: Prompt r T
 
pexi :: Prompt r T
 
quant_order :: QuantOrder
 
pcnt :: Prompt r (Int -> CC r T)
 

newtype SemM r a Source

The Semantic monad

Constructors

SemM (ReaderT (SemEnv r) (CC r) a) 

Instances

Monad (SemM r) 
Abstract (SemM r) 

unSem :: SemM r a -> SemEnv r -> CC r aSource

runSem :: QuantOrder -> (forall r. SemM r T) -> TSource

app :: Monad m => m (a -> m b) -> m a -> m bSource

Movement into the position of the prompt selected by psel

Logical forms of sample terms in different semantic environment

Auxiliary functions

genvar :: SemM r VarnameSource

Generate a new variable name

shiftP :: Prompt r b -> ((a -> CC r b) -> CC r b) -> CC r aSource