Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

The EM LCT Master Program the University Nancy 2

Supervised Project

Intoducing Dynamics in the Program to


Tackle Montague Semantics with Dynamics

Author Lasha Abzianidze


Supervisor Prof. Philippe de Groote

08.06.2010
Agenda

• Objective Caml

• Initial Program

• Dynamic Logic

• Implementing Dynamics
Objective Caml

Objective Categorial Abstract Machine Language

• The main implementation of Caml:


OCaml = Caml + Object-oriented
• Developed and distributed by INRIA since 1985
• Main features of the language:
Functional (ML type), Imperative and Object-oriented
Static type system
Polymorphic type system
Expressive module system
Initial Program

Initial Program

• Written in OCaml by Prof. de Groote


• Performs calculations in simply-typed λ-calculus
Define constants and identifiers
Build complex λ-terms
α-conversions, β-reductions, normalization
Type λ-terms
using polymorphism
Error reporting
Syntax and typing
Initial Program

Demonstration
FARMER := farmer;
DONKEY := donkey;
A := lambda P Q. exists (lambda y. conj (P y) (Q y));
BEATS := lambda O S. S (lambda x. O (lambda y. beat x y));

where

farmer : i -> o;
donkey : i -> o;
beat : i -> (i -> o);

BEATS (A DONKEY) (A FARMER);


Initial Program

Program Architecture
main.ml

type.ml

normalize.ml parse.ml

print.ml

syntax.ml lex.ml
Dynamic Logic

Montague Semantics
It is based on Church’s simple-type theory providing
a hierarchy of functional types built upon 2 atomic types:
 - the type of individuals;
 - the type of propositions;
Dynamics and Dynamic Logic (by Prof. Philippe de Groote)
For introducing a notion of context, a third atomic type 
is added, which stands for the type of the left context.
Type of the proposition is     (   )  
LEFT CONTEXT SENTENCE RIGHT CONTEXT

   (   )    
Dynamic Logic

Formal Framework for Dynamic Logic


Simply-typed λ-calculus with signature:
A set of Atomic types: { ,  ,  }
A set of constants: { ,  ,  , , sel,::}
Typing: truth
 :
 :   negation
 :     conjunction
 : (   )   existential quantification
:: :      context updating
sel :    choice operator
Dynamic Logic

Dynamic Operators

Dynamic conjunction:
     e . e (  e. e )
Dynamic existential quantification:
 x. Px   e . x . Px ( x :: e )
Dynamic negation:
~    e . (  e (  e. ))   e
These are one of the key equations used in implementation
of dynamics in the program.
Dynamic Logic

Other Defined Dynamic Operators

Dynamic implication:
   ~ (  ~ )
Dynamic disjunction:
    ~ (~   ~  )
Universal quantification:

 x . Px  ~  x . ~ ( Px )
Dynamic Logic

Embedding First-order logic formula into Dynamic logic

Embedding is done according to the following equations:

R t1 ...t n   e . R t1 ...t n   e

 ~ 

    

 x .   x .
These are one of the key equations used in implementation
of dynamics in the program.
Implementing Dynamics

Introducing dynamic function

The aim of the project was to introduce dynamics in the


existing program.
The easiest and logical solution is to define (“dynamizing”)
function converting λ-term into dynamic version.
dyn : λ-term → dynamic version of λ-term

Implemented
Adding dyn function and
dedicating one module dynamic.ml to it.
Implementing Dynamics

dyn function and dynamic.ml module


main.ml

type.ml

normalize.ml parse.ml

print.ml dynamics.ml

syntax.ml lex.ml
Implementing Dynamics

Demonstration
Let us consider a donkey sentence:
Every farmer who has a donkey beats it.
[farm er ]  farm er
[donkey ]  don key
[ow ns]   O S . S (  x .O (  y .ow n x y ))
[beats]   O S . S (  x .O (  y .beat x y ))
[ w ho ]   R Q x .Q x  R (  P . P x )
[a ]   P Q . x . P x  Q x
[every ]   P Q . x . P x  Q x
[it ]  ???

it   Pe . P (sel e ) e
Implementing Dynamics

Demonstration
OWNS := lambda O S. S(lambda x. O(lambda y. own x y));
WHO := lambda R Q x. conj (Q x) (R (lambda P. P x));
EVERY := lambda P Q. neg( exists (lambda x. conj (P x) (neg(Q x))));

dynIT := lambda P L R. P (sel L) L R

where

own : i -> i -> o;

dyn BEATS dynIT ( dyn (EVERY (WHO (OWNS (A DONKEY)) FARMER )));
Implementing Dynamics

Analyzing output

 L R .   x . ( farm er x )   a . ( don key a )   ow n x a     beat x (s e l ( u a ( u xL )))      R L 

 L R .   x .  ( farm er x )    a . ( don key a )   ow n x a     beat x (s e l ( u a ( u xL )))    R L 

 L R .   x . ( farm er x )   a .   ( don key a )   ow n x a     beat x (s e l ( u a ( u xL )))    R L 

 L R .   x . ( farm er x )   a .  ( don key a )   ow n x a     beat x (s e l ( u a ( u xL )))    R L


Implementing Dynamics

THANK YOU

You might also like