Knowledge interchange

38
KIF and Common Logic Presentation By Balaji Gourabathina [email protected]

description

KIF and Common Logic. Knowledge interchange. Presentation By Balaji Gourabathina [email protected]. Knowledge Interchange?. Exchange of knowledge among different systems. Why do we need to interchange knowledge?. Knowledge is power supreme!! Basic reason: Communication - PowerPoint PPT Presentation

Transcript of Knowledge interchange

Page 1: Knowledge interchange

KIF and Common Logic

Presentation By

Balaji [email protected]

Page 2: Knowledge interchange

Knowledge Interchange?

Exchange of knowledge among different systems

Page 3: Knowledge interchange

Why do we need to interchange knowledge? Knowledge is power supreme!! Basic reason: Communication How do we do this ? Many ways and most of them are well

known

Page 4: Knowledge interchange

In the context of computing world…… It is the same Differs in who and how we/they do it To be specific : We need to know how

computing systems exchange knowledge

Page 5: Knowledge interchange

This presentation

Focuses on two knowledge interchange mechanisms

KIF CL

Page 6: Knowledge interchange

Why FOL not sufficient?

The friendly features of FOL can be liabilities on open networks

Assumptions about syntactic type and signature can differ across frameworks

Inference rules must apply to names in a uniform way

Page 7: Knowledge interchange

KIF : Knowledge Interchange Format Knowledge Interchange Format (KIF) is

a language designed for use in the interchange of knowledge among disparate computer systems

~(KIF is intended as a primary language for interaction with human users)

~(KIF is also intended as an internal representation for knowledge within computer systems)

Page 8: Knowledge interchange

How does it work?

when a computer system reads a knowledge base in KIF, it converts the data into its own internal form

All computation is done using these internal forms

When the computer system needs to communicate with another computer system, it maps its internal data structures into KIF

Page 9: Knowledge interchange

Categorical features essential to the design of KIF The language has declarative semantics The language is logically comprehensive The language provides for the

representation of knowledge about knowledge

Designed to maximize,implementability and readability

Page 10: Knowledge interchange

Syntax of KIF

Three layers Characters-Basic characters of the

languageLexemes-Combination of charactersExpressions-Grammatically legal

combination of lexemes

Page 11: Knowledge interchange

Characters

Classification of KIF charactersUpper case lettersLower case lettersDigitsAlpha charactersSpecial charactersWhite spaceOther characters

Page 12: Knowledge interchange

Lexemes

Lexical analysis-Process of converting characters into lexemes is called lexical analysis

Five types of lexemes in KIFSpecial lexemesWordsCharacter referencesCharacter stringsCharacter blocks

Page 13: Knowledge interchange

Lexemes-contd.. Each special character is a lexeme by

itself A word is a contiguous sequence of (1)

normal characters or (2) other characters preceded by the escape character \.

word ::= normal | word normal | word\character

Character referenceCharref :: = #\character

Page 14: Knowledge interchange

Lexemes-contd.. Character string

String :: = “quotable” quotable ::= empty | quotable strchar | quotable\character strchar ::= character - {",\}

A character block consists of the character # followed by the decimal encoding of a positive integer n, the character q or Q, and then n arbitrary characters Used in encoding audio, video and special formats

Variable -A word in which the first character is ? or @ Individual variable – beginning with ? Sequence variable – beginning with @

Page 15: Knowledge interchange

Lexemes-contd.. Operators-Form complex expressions of

various sortsTerm OperatorsSentence OperatorsDefinition Operators

Constants- All other wordsObject constants- Denote individual objectsFunction constants-Functions on those objectsRelation constants-Denote RelationsLogical constants-True or False

NOTE: The differences between these constants is only semantic not syntactic

Page 16: Knowledge interchange

Expressions

Three disjoint types of expressionsTerms-Denote ObjectsSentences-Express factsDefinitions-Define constants

Forms- Definitions and sentences Knowledge base – Finite set of forms

Page 17: Knowledge interchange

Terms 9 Types

Individual variablesConstantsCharacter ReferencesCharacter StringsCharacter BlocksFunctional TermsList TermsQuotationsLogical Terms

Page 18: Knowledge interchange

Terms…contd Functional Terms

Implicit functional term-Consists of a constant and an arbitrary number of argument terms, terminated by an optional sequence variable and surrounded by matching parentheses

Explicit functional term-consists of the operator value and one or more argument terms, terminated by an optional sequence variable and surrounded by matching parentheses

List term - consists of the listof operator and a finite list of terms, terminated by an optional sequence variable and enclosed in matching parentheses

Page 19: Knowledge interchange

Terms…contd

Quotations-involve the quote operator and an arbitrary list expression

Logical terms-involve the if and cond operators

Page 20: Knowledge interchange

Sentences BNF defines the set of legal sentences in KIF 6 Types of sentences

ConstantsEquation –Consists of = and two termsImplicit relational sentence-consists of a constant

and an arbitrary number of argument terms, terminated by an optional sequence variable

Explicit relational sentence-consists of the operator holds and one or more argument terms, terminated by an optional sequence variable and surrounded by matching parentheses

Page 21: Knowledge interchange

Basics In order to allow a user to express the idea

that a function is not meaningful for certain arguments, KIF assumes that there is a special "undefined" object in the universe and provides the object constant bottom to refer to this object

Functional Terms: Computation of values is better illustrated with examples(+ 2 3) = 2+3=5(+ 1 @1)= 1+2+3+4=10,where @1 is a

sequence variable 2,3,4

Page 22: Knowledge interchange

Basics…contd Relational sentences

A simple relational sentence without a terminating sequence variable is true if and only if the relation denoted by the relation constant in the sentence is true of the objects denoted by the arguments

If a relational sentence terminates in a sequence variable, the sentence is true if and only if the relation contains the tuple consisting of the values of the terms that precede the sequence variable together with the objects in the sequence denoted by the variable

Equations and Inequalities An equation is true if and only if the terms in the equation

refer to the same object in the universe of discourse. An inequality is true if and only if the terms in the equation

refer to distinct objects in the universe of discourse.

Page 23: Knowledge interchange

Logic Logical Terms

(if (> a 0) a (- a)) : absolute value of a number (if (> 1 2) 1 (> 2 1) 2 0) = 2

Logical Sentences Similar to rules of inference

Quantified Sentences A simple existentially quantified sentence is true if and only if the

embedded sentence is true for some value of the variables mentioned in the first argument

A simple universally quantified sentence is true if and only if the embedded sentence is true for every value of the variables mentioned in the first argument

Definitions No truth value (defobject s := t) (= s t)

Page 24: Knowledge interchange

Numbers The referent of every numerical constant in

KIF is assumed to be the number for which that constant is the base 10 representation

Inequality of distinct numerical constants can be inferredFor every t1 and distinct t2 the following sentence is

true. (/= t1 t2)

Functions on Numbers : Discussed earlier Relations on Numbers

Examples,(defrelation number (?x) := (or (real ?x) (complex ?

x)))

Page 25: Knowledge interchange

Lists Finite sequence of objects Any objects in the universe of discourse can

be the elements of a list (listof t1 ... tk) denotes the list of objects

denoted by t1, ..., tk nil denotes empty list and null tests whether

or not an object is the empty list The functions first, rest, last, and but last each

take a single list as argument and select individual items or sublists from those lists

Some of the functions include append,reverse,adjoin,length etc

Page 26: Knowledge interchange

Characters and Strings There are 128 distinct characters known to

KIF, corresponding to the 128 possible combinations of bits in the ASCII encoding

Two ways to refer to characters The first method is use of charref syntax, i.e.

the characters # and \, followed by the character to be represented

Second, 7 bit code corresponding to the character

The relationship between characters and their numerical codes is given via the functions char-code and code-char

Page 27: Knowledge interchange

Strings

List of characters Three ways to refer strings

Enclose it in double quotesUse of character blocks by prefixing with #Using listof function(Useful because it allows

us to quantify over characters with strings)

Page 28: Knowledge interchange

KIF:Theoritical Problems

The formalization problemNo general model theory for all constructs of

KIF○ Hence, no rigorous general notion of meaning

KIF is developed before the emergence of semantic webNot standardizedDoesn’t follow XML-based paradigmConnections to RDF/OWL unclear

Page 29: Knowledge interchange

Common Logic

Common Logic is a framework for a family of logic-based languages with the purpose of standardizing syntax and semantics for information interchange

Provides the basis for a set of syntactic forms (dialects) all sharing a common semantics

An XML framework for encoding and transmitting in an open network.

Page 30: Knowledge interchange

CL..contd Abstract generalization and extension to

KIF Full-FOL expressibility Designed for easy and natural use on web Flexibility to use in open networks No gratuitous assumptions about logical

relationships between expressions(found in different ontologies)

Page 31: Knowledge interchange

CL : Abstract Syntax Text : Either a set or list or bag of phrases

A piece of text that can be identified with a name

Phrase: Comment ,module, sentence A comment is a piece of data

No restrictions Comments can be attached to other comments

Module: Consists of a name and a text called the “body text”Indicates the local domain of discourse

Importation: Contains a name

Page 32: Knowledge interchange

CL : Abstract Syntax…contd Sentence : An atom , a Boolean sentence

or a quantified sentence A Boolean sentence has a type, called a

connective and a number of sentences ,called the components of the sentence

A quantified sentence has a type called quantifiera finite,nonrepeating sequence of names and

sequence markers called the binding sequence, each element of which is called a binding of the quantified sentence,

and a sentence called the body of the quantified sentence.

Page 33: Knowledge interchange

CL:Abstract Syntax….contd An atom is either an equation containing two arguments,

which are terms, or an atomic sentence. An atomic sentence consists of a term, called the predicate,

and a term sequence called the argument sequence. Each term in the term sequence of an atomic sentence is

called an argument of the sentence. Any name can be the predicate in an atomic sentence.

A term is either a name or a functional term. Terms may have attached comments.

A functional term consists of a term, called the “operator,” and a term sequence called the “argument sequence”

A term sequence is a finite sequence of terms or sequence markers. A term sequence may be empty.

Page 34: Knowledge interchange

Traditional Model Theory

Traditional model theories for first-, second-, and higher-order logics map each name/variable type to a different semantic construct

First-order logic permits quantification over individuals only

Higher-order logics permit quantification over functions/classes/relations

Page 35: Knowledge interchange

Traditional Model Theory Two things prevent “collapsing” individuals,

functions, classes, relations into a single domain of logical individuals

Cardinality problems: There are more functions/classes/relations over individuals than there are individuals

Well-foundedness problems: Functions/classes/relations in standard HO logic defined as sets of (ordered ntuples of) individuals Hence, if functions/classes/relations are treated as

individuals, we have to be able to make sense of functions that apply to themselves, classes that contain themselves, and relations that relate themselves to other individuals.

This violates the well-foundedness condition in standard set theories

Page 36: Knowledge interchange

CL Model Theory In CL’s model theory, everything is a

logical individualOnly names in CL dialects; VARIABLE is a

syntactic role Each individual has function and relation

extensions. Classes treated as 1-place relations

○ No fixed “arity” One relation extension can contain n-tuples, for

different nCardinality and Well-foundedness problems

avoided

Page 37: Knowledge interchange

CL and the shortcomings of KIF Formalization

CL has a rigorous model theory for all of its constructs and a proof theory

Specification CL specifies structure rather than any particular form This provides a general basis for determining/establishing

conformance to CL syntax, hence a basis for meaning preserving translation

CL is an international ISO standard (ISO/IEC 24707)

CL framework includes XCL, an XML-based instance of CL Includes numerous web-oriented features

Page 38: Knowledge interchange

Questions??