LDK R Logics for Data and Knowledge Representation Exercise 1: Model and Language.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Ontology From Wikipedia, the free encyclopedia In philosophy, ontology (from the Greek oν, genitive oντος: of being (part. of εiναι: to be) and –λογία:
Grammars.
Logics for Data and Knowledge Representation Modeling Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia, Rui Zhang.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 330 Programming Languages 09 / 13 / 2007 Instructor: Michael Eckmann.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Chapter 3: Formal Translation Models
The Language of Propositional Logic The Syntax and Semantics of PL.
Logics for Data and Knowledge Representation Exercises: Languages Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Intro to Discrete Structures
1 Syntax and Semantics The Purpose of Syntax Problem of Describing Syntax Formal Methods of Describing Syntax Derivations and Parse Trees Sebesta Chapter.
Grammars.
Chpater 3. Outline The definition of Syntax The Definition of Semantic Most Common Methods of Describing Syntax.
LDK R Logics for Data and Knowledge Representation Context Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Logics for Data and Knowledge Representation
Applications of Propositional Logic
CS 355 – PROGRAMMING LANGUAGES Dr. X. Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax.
LDK R Logics for Data and Knowledge Representation Modeling First version by Alessandro Agostini and Fausto Giunchiglia Second version by Fausto Giunchiglia.
Logics for Data and Knowledge Representation Exercises: Modeling Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.
CS Describing Syntax CS 3360 Spring 2012 Sec Adapted from Addison Wesley’s lecture notes (Copyright © 2004 Pearson Addison Wesley)
Grammars CPSC 5135.
LDK R Logics for Data and Knowledge Representation ClassL (part 3): Reasoning with an ABox 1.
Pattern-directed inference systems
ISBN Chapter 3 Describing Syntax and Semantics.
TextBook Concepts of Programming Languages, Robert W. Sebesta, (10th edition), Addison-Wesley Publishing Company CSCI18 - Concepts of Programming languages.
LOGIC AND ONTOLOGY Both logic and ontology are important areas of philosophy covering large, diverse, and active research projects. These two areas overlap.
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
1 Syntax In Text: Chapter 3. 2 Chapter 3: Syntax and Semantics Outline Syntax: Recognizer vs. generator BNF EBNF.
Logics for Data and Knowledge Representation Languages for Data Representation First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Computing & Information Sciences Kansas State University Wednesday, 20 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 12 of 42 Wednesday, 20 September.
Copyright © Curt Hill Languages and Grammars This is not English Class. But there is a resemblance.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
LDK R Logics for Data and Knowledge Representation PL of Classes.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
CS6133 Software Specification and Verification
ISBN Chapter 3 Describing Syntax and Semantics.
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2010 Most slides modified from Discrete Mathematical Structures: Theory and Applications by D.S. Malik.
LDK R Logics for Data and Knowledge Representation ClassL (Propositional Description Logic with Individuals) 1.
Logics for Data and Knowledge Representation Exercises: ClassL Fausto Giunchiglia, Rui Zhang and Vincenzo Maltese.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
LDK R Logics for Data and Knowledge Representation Description Logics: family of languages.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Syntax.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
7.2 Programming Languages - An Introduction to Informatics WMN Lab. Hye-Jin Lee.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Artificial Intelligence Logical Agents Chapter 7.
Logics for Data and Knowledge Representation
System Software Unit-1 (Language Processors) A TOY Compiler
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Presentation transcript:

LDK R Logics for Data and Knowledge Representation Exercise 1: Model and Language

Outline  Modeling  Logical Modeling  What and How  Exercises  Languages  BNF  Exercises 2

Modeling 3 The World Model Language + Theory (Abstraction) Modeling Realization Representation Interpretation Monkey Banana Box …

Logical Modeling 4

What?  Domain (D) = the chosen objects from the world who can figure out the domain of the LDKR course?  From the person point of view:  students, professor;  Italian, Chinese, …  white-haired, black-eyed,…  From the material point of view:  courseware, homework, exam,…  logics, modeling, …  From … ? 5

What else?  Language (L) = a logical language  Syntax 1. L’s alphabet of symbols Σ contains at least one of the logical symbols: ∧, ∨, ¬, →, ∀, ∃ ; 2. L has clear formation rules for formulas.  Formal Syntax: the set of “rules” saying how to construct the expressions of the language from the alphabet of symbols, (i.e., the syntax) is a grammar (i.e., formal).  Semantics  Interpretation (I) = a mapping of L into D.  Formal Semantics: the relationship between syntactic constructs and the elements of an universe of meanings is a function in mathematical sense. 6

How?  Model (M) = the abstract (mathematical sense) representation of the intended truths via interpretation I of language L. M is called L- model of D.  M |=A  reads?  satisfies, yields, holds, is true.  Theory (T, also L-Theory) = set of facts of L.  A fact defines a piece of knowledge (about D), something true in the model.  A finite theory T is called a knowledge base (KB). 7

Modeling Exercises  Select from the following domain to model (5 minutes preparation) 1. Classroom Student, Master & Doctor, Professor, Assistant,… 2. Family Parent, Grandparent, Male, Female, Sibling,… 3. Friend Close, Hiking, Chess, Forum, … 8

Possible Solutions 1  Classroom 9 Person Student Professor PhD Master

Possible Solutions 2  Family 10 MaleFemale Parent Grandparent BrotherSister Sibling

Possible Solutions 3  Friend 11 Friend Hiking Chess Forum Close

 Let’s look at this sheet in a DB:  What’s it like? A Database 12 IDNameNationalityHair ColorAffiliation 1FaustoItalianWhiteProfessor 2EnzoItalianBlackPhD 3RuiChineseBlackT.A. 4… 5… …… LDKR Italian Black Hair Master

Closed world vs. Open world  DB follows CWA, which assumes negative when no record found.  Closed word assumption (CWA) is the presumption that what is not currently known to be true, is false.  In contrast, ClassL assumes OWA, which allows ‘new’ knowledge emerges.  Open world assumption (OWA) is the assumption that the truth-value of a statement is independent of whether or not it is known by any single observer or agent to be true.  NOTE: In general no single agent or observer has complete knowledge, and therefore cannot make the closed world assumption. 13

Example  Recall the DB table in previous slide:  A theory of this world in ClassL: T={}, A={Italian(Fausto), Italian(Enzo), Chinese(Rui), White-Hair(Fausto), Black-Hair(Enzo), Black- Hair(Rui), Professor(Fausto), PhD(Enzo), TA(Rui), …} 14 IDNameNationalityHair ColorAffiliation 1FaustoItalianWhiteProfessor 2EnzoItalianBlackPhD 3RuiChineseBlackT.A. 4… 5… ……

Outline  Modeling  Logical Modeling  What and How  Exercises  Languages  BNF  Exercises 15

Backus–Naur Form (BNF)  In computer science, Backus–Naur Form (BNF) is a syntax used to express context-free grammars: that is, a formal way to describe formal languages.  Optional items enclosed in square brackets [].  Items repeating 0 or more times are enclosed in curly brackets or suffixed with an asterisk. {} or *  Items repeating 1 or more times are followed by a '+'  Terminals may appear in bold and NonTerminals in plain text rather than using italics and angle brackets <>.  Alternative choices in a production are separated by the ‘|’ symbol.  Where items need to be grouped they are enclosed in simple parentheses (). 16

Example of BNF  Who can give examples of the above syntaxes?  An example of mathematical expression 1. ::= [ ] 2. ::= [ ] [. ] 3. ::= { }* 4. ::=0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 5. ::=+ | - 6. ::=+ | - | * | / 17

Exercises of BNF  Is the following a well-formed formula of expression? * /( )  Recall the BNF of PL, and differentiate WFFs from others below. 1. A ⊔ B ⊒ A 2. A ⊓ B ⊑ B 3. A ∧¬ B → A 4. A ∧ B ⊨ A ∨ B 5. ¬ A ∨ B ⊢ A → B 18

Something challenging  Can we build the BNF of ER diagram?  What about the BNF of natural language of English? 19

 In software engineering, an Entity-Relationship Model (ERM) is an abstract and conceptual representation of data.  The basic components of ER in Lecture 2:  Entity  Relation  Cardinality of Relation  Cardinality of Attribute  Attribute  Primary Key Recall: ER Diagram 20 MonkeyBox Climb n Banana Height ID

BNF of ER Diagram  Build the Backus–Naur Form (BNF) of ER diagram system. ::= ::={ }| + [ ] + | Entity + [ ] 21 Entity Relation Attribute ”.. “ n | m

BNF of Yahoo DirectoriesYahoo Directories  The Yahoo! Directory is an online guide to the World Wide Web. It is a catalog of sites created by a staff of editors who visit and evaluate web sites, and then organize them into subject-based categories and sub-categories.  Yahoo! editors distinguish between a number of factors when organizing web sites, including commercial vs. non-commercial, regional vs. global, and so forth. All of the site listings in the Directory are contained in an appropriate place within the 14 main categories seen on the front page of the Yahoo! Directory. 22

So take a look! 23

Preliminaries: Open/Close Word Class  In linguistics, an open class (or open word class) is a word class that accepts the addition of new items, through such processes as compounding, derivation, coining, borrowing, etc. Typical open word classes are nouns, verbs and adjectives.  A closed class (or closed word class) is a word class to which no new items can normally be added, and that usually contains a relatively small number of items. Typical closed classes found in many languages are adpositions (prepositions and postpositions), determiners, conjunctions, and pronouns. 24

Parts of Speech Open class WORD CLASSEXAMPLE JJ//Adjective blue green soft NN//Noun, singular or mass apple sugar NNS//Noun, plural apples NNP//Proper noun, singular Rui RB//Adverb slowly VB//Verb, base form go VBD//Verb, past tense went VBZ//Verb, 3rd person singular present goes 25

Parts of Speech (2) Closed class WORD CLASSEXAMPLE CC//Coordinating conjunction and or CD//Cardinal number DT//Determiner the an a IN//Preposition or subordinating conjunction in for but POS//Possessive ending TO//to 26

BNF for Yahoo Directory (1)ForwardPhrase::= [VB] [IN] DisPhrase {Conn } DisPhrase (2)DisPhrase::= Phrase [“(”ProperDis | NounDis“)”] [“(”Period“)”][“:” Phrase] (3)Phrase::=[DT] Adjectives [Nouns] | [Proper] Nouns (4)Adjectives::= Adjective|CD {[CC] Adjective} (5)Nouns::= Noun {Noun} (6)Conn::= ConjunctionConn | PrepositionConn (7)Noun::= NN [POS] | NNS [POS] 27

BNF for Yahoo Directory (2) (8)Adjective::= JJ (9)ConjunctionConn::= CC | “,” (10)PrepositionConn::= IN | TO (11)Proper::= NNP {NNP|POS} (12)NounDis::= Period|Nouns|Adjectives [Nouns] (13)ProperDis::= ProperSeq [CC ProperSeq] (14)Period::= [NN] CD [“-”] [CD] [NN] (15)ProperSeq::= Proper [“,” Proper] 28

Example: Provinces and Districts ForwardPhraseConnForwardPhrase DisPhraseConjunctionConn DisPhrase Phrase CCPhrase Nouns NounNNS 29

Exercises  Directory > Science > Computer Science > Artificial Intelligence > Natural Language Processing > Web Directories  Computer ScienceNN  Artificial Intelligence JJNN  Natural Language Processing JJNNVBG  Web Directories NNNNS 30