SPNLP: Propositional Logic, Predicates Semantics and Pragmatics of NLP and Functions Lascarides & Propositional Logic, Predicates and Klein Functions Outline Motivation Propositional Logic Alex Lascarides & Ewan Klein Predicates and Functions Implementing Function School of Informatics expressions in University of Edinburgh NLTK 10 January 2008
SPNLP: Propositional Logic, Predicates and Functions Motivation 1 Lascarides & Klein Outline 2 Propositional Logic Motivation Propositional Logic Predicates 3 Predicates and Functions and Functions Implementing Function expressions in NLTK Implementing Function expressions in NLTK 4
Why Bother? SPNLP: Propositional Logic, Aim: Predicates and Functions Lascarides & 1 To associate NL expressions with semantic Klein representations; Outline 2 to evaluate the truth or falsity of semantic Motivation representations relative to a knowledge base; Propositional Logic 3 to compute inferences over semantic representations. Predicates and Functions Strategy: Implementing Function expressions in Deal with task (1) later, but assume the target is FOL . . . NLTK Achieve tasks (2)–(3) by associating FOL with models and rules of inference.
Logics: Syntax and Semantics SPNLP: Propositional Logic, Predicates and Functions 1 A Vocabulary (aka lexicon) Lascarides & Klein determines what we can talk about Outline 2 Syntax Motivation Uses vocabulary and syntactic rules to define the set of Propositional well-formed formulas ( WFF s) Logic determines how we can talk about things Predicates and Functions 3 Semantics Implementing Function Compositional (uses recursion) expressions in Truth, Satisfaction, Entailment. NLTK
The Language of Propositional Logic, version 1 SPNLP: Propositional Basic expressions: Logic, Predicates and Functions 1 Propositional variables p , q , r , p 0 , p 1 , . . . . Lascarides & Klein 2 Boolean connectives: ¬ (negation) ∧ (and) Outline ∨ (or) Motivation Propositional → (if. . . then) Logic Predicates Rules of syntax: and Functions Implementing Function 1 Every propositional variable is a well-formed formula expressions in NLTK ( WFF ). 2 If φ and ψ are WFF s, then so are: ¬ φ , ( φ ∧ ψ ) , ( φ ∨ ψ ) , ( φ → ψ ) .
Models for Propositional Logic, version 1 SPNLP: Propositional Logic, Predicates Interpretation Function: A mapping V from each and Functions propositional variable to the set of truth values {0, 1}. Lascarides & Klein Outline A Valuation Motivation Propositional V ( p ) = 1 Logic Predicates V ( q ) = 0 and Functions V ( r ) = 1 Implementing Function expressions in NLTK A model M for propositional logic is just a valuation V . For an arbitrary WFF φ , we write M | = φ to mean φ is true in model M .
Models for Propositional Logic, version 1 SPNLP: Propositional Logic, Predicates and Functions Lascarides & Klein Recursive definition of truth in a model M = V . Outline M | = p i iff V ( p i ) = 1 Motivation M | = ¬ φ iff M �| = φ Propositional Logic M | = φ ∧ ψ iff M | = φ and M | = ψ Predicates M | = φ ∨ ψ iff M | = φ or M | = ψ and Functions M | = φ → ψ iff M �| = φ or M | = ψ Implementing Function expressions in NLTK
Adding Predicates to the Language SPNLP: Propositional Logic, FOL designed to talk about various relationships and Predicates and Functions properties that hold among individuals. Lascarides & Klein Terms Unary Predicates Binary Predicates Outline john dog chase Motivation mary girl kiss Propositional Logic kim run Predicates fido smile and Functions Implementing Function NB: nouns and intransitive verbs treated the same. expressions in NLTK The vocabulary constrains the class of models (that is, the kinds of situation we want to describe).
Models for FOL, version 1 SPNLP: Propositional Logic, Predicates Domain: The collection D of entities we can talk about; and Functions Lascarides & Interpretation Function: A mapping V from each Klein symbol in the vocabulary to its semantic value. Outline The arity of a symbol s determines what kind of value Motivation V ( s ) should be. Propositional Logic Predicates and Functions Valuations Implementing Function expressions in V ( fido ) ∈ D NLTK V ( dog ) ⊆ D V ( chase ) ⊆ D × D
Valuations for Terms and Predicates SPNLP: Propositional Logic, A Valuation Predicates and Functions Lascarides & M = � D , V � , where: Klein D = { d 1 , d 2 , d 3 , d 4 } Outline Motivation V ( john ) = d 1 V ( dog ) = { d 4 } Propositional Logic V ( mary ) = d 2 V ( girl ) = { d 2 , d 3 } Predicates V ( kim ) = d 3 V ( run ) = { d 4 } and Functions V ( fido ) = d 4 V ( smile ) = { d 1 } Implementing Function V ( chase ) = { ( d 2 , d 3 ) , ( d 3 , d 4 ) } expressions in NLTK V ( kiss ) = { ( d 2 , d 1 ) , ( d 1 , d 2 ) } M | = R ( τ 1 , . . . , τ n ) iff ( V ( τ 1 ) , . . . V ( τ n )) ∈ V ( R )
Alternative Approach to Predicates SPNLP: Propositional Logic, Predicates We take function expressions as basic to our language, and Functions corresponding to functions in the model. Lascarides & Klein It’s helpful to regard the function expressions as typed; e.g., α σ → τ combines with expressions of type σ to yield Outline Motivation expressions of type τ . Propositional Logic Predicates and Functions A Boolean-valued Function Expression Implementing Function dog IND → BOOL expressions in NLTK i.e., combines with terms to yield expressions with Boolean values ( WFF s).
Alternative Approach to Predicates SPNLP: Propositional Logic, Predicates We take function expressions as basic to our language, and Functions corresponding to functions in the model. Lascarides & Klein It’s helpful to regard the function expressions as typed; e.g., α σ → τ combines with expressions of type σ to yield Outline Motivation expressions of type τ . Propositional Logic Predicates and Functions A Boolean-valued Function Expression Implementing Function dog IND → BOOL expressions in NLTK i.e., combines with terms to yield expressions with Boolean values ( WFF s).
Alternative Approach to Predicates SPNLP: Propositional Logic, Predicates We take function expressions as basic to our language, and Functions corresponding to functions in the model. Lascarides & Klein It’s helpful to regard the function expressions as typed; e.g., α σ → τ combines with expressions of type σ to yield Outline Motivation expressions of type τ . Propositional Logic Predicates and Functions A Boolean-valued Function Expression Implementing Function dog IND → BOOL expressions in NLTK i.e., combines with terms to yield expressions with Boolean values ( WFF s).
Alternative Approach to Predicates SPNLP: Propositional Logic, Predicates We take function expressions as basic to our language, and Functions corresponding to functions in the model. Lascarides & Klein It’s helpful to regard the function expressions as typed; e.g., α σ → τ combines with expressions of type σ to yield Outline Motivation expressions of type τ . Propositional Logic Predicates and Functions A Boolean-valued Function Expression Implementing Function dog IND → BOOL expressions in NLTK i.e., combines with terms to yield expressions with Boolean values ( WFF s).
Functions in the model SPNLP: Types are pretty much the same as arities. Propositional Logic, Predicates and Functions V ( α IND ) ∈ D Lascarides & V ( α BOOL ) ∈ { 0 , 1 } Klein V ( α σ → τ ) ∈ T S , which is the set of all functions from the Outline Motivation denotations of expressions of type σ to the denotations Propositional of expressions of type τ . Logic Predicates and Functions Write f : X �→ Y for a function which takes arguments from Implementing X and maps them to values in Y . Function expressions in NLTK V ( α IND → BOOL ) V ( dog ) ∈ { 0 , 1 } D = { f | f : D �→ { 0 , 1 }}
Functions in the model SPNLP: Types are pretty much the same as arities. Propositional Logic, Predicates and Functions V ( α IND ) ∈ D Lascarides & V ( α BOOL ) ∈ { 0 , 1 } Klein V ( α σ → τ ) ∈ T S , which is the set of all functions from the Outline Motivation denotations of expressions of type σ to the denotations Propositional of expressions of type τ . Logic Predicates and Functions Write f : X �→ Y for a function which takes arguments from Implementing X and maps them to values in Y . Function expressions in NLTK V ( α IND → BOOL ) V ( dog ) ∈ { 0 , 1 } D = { f | f : D �→ { 0 , 1 }}
Functions in the model SPNLP: Types are pretty much the same as arities. Propositional Logic, Predicates and Functions V ( α IND ) ∈ D Lascarides & V ( α BOOL ) ∈ { 0 , 1 } Klein V ( α σ → τ ) ∈ T S , which is the set of all functions from the Outline Motivation denotations of expressions of type σ to the denotations Propositional of expressions of type τ . Logic Predicates and Functions Write f : X �→ Y for a function which takes arguments from Implementing X and maps them to values in Y . Function expressions in NLTK V ( α IND → BOOL ) V ( dog ) ∈ { 0 , 1 } D = { f | f : D �→ { 0 , 1 }}
Recommend
More recommend