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



Context-free grammar with quantifiers A different ways to add quantification, via Higher-Order abstract syntax (HOAS). This is a rational reconstruction of Montague's general approach of `administrative pronouns', which later gave rise to the Quantifier Raising (QR)



class Symantics repr => Quantifier repr whereSource

No longer any need in a new syntactic category QNP We leave out CN as an exercise

 data CN                                      -- Common noun

We extend our earlier fragment with quantifiers everyone, someone. In contrast to QCFG.hs, we do not add any new syntactic category, so we don't need to add any rules to our CFG.


everyone :: (repr NP -> repr S) -> repr SSource

someone :: (repr NP -> repr S) -> repr SSource


Quantifier EN

Sample sentences (or, CFG derivations): compare with those in QCFG.hs 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 quantifiers.

Lambda lrepr => Quantifier (Sem lrepr)

We can now see the English sentences that correspond to the derivations sen2-sen4.

We also extend the semantics interpreter: the interpreter of a derivation into a formula of STT, or Lambda-calculus. We reconstruct Montague's ``pronoun trick''