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

Lambda.QCFG

Description

Context-free grammar with quantifiers

We extend CFG.hs to add quantified noun phrases in the tradition of Montague

Synopsis

Documentation

data CN Source

Additional syntactic categories

data QNP Source

class Symantics repr => Quantifier repr whereSource

We extend our earlier fragment with common nouns farmer and donkey, and quantifiers everyone, someone, every farmer, a donkey, etc. Since we added two new categories (CN and QNP), we need to add rules to our CFG to be able to use the categories in derivations.

The numbers 4 and 5 are due to Montague

Methods

farmer :: repr CNSource

donkey :: repr CNSource

everyone :: repr QNPSource

someone :: repr QNPSource

every :: repr CN -> repr QNPSource

a :: repr CN -> repr QNPSource

who :: repr VP -> repr CN -> repr CNSource

r5 :: repr TV -> repr QNP -> repr VPSource

r4 :: repr QNP -> repr VP -> repr SSource

Instances

Quantifier EN

Sample sentences (or, CFG derivations) We stress that the inferred type of sen2-sen4 is S. So, these are the derivations of complete sentences.

We extend our EN interpreter (interpreter of derivations as English phrases) to deal with QNP.

Quantifier JA

The expression for quantifiers ensures that no inverse reading is possible. Only linear reading.

Lambda lrepr => Quantifier (Sem lrepr)