1416_Knowledge interchange

KIF and Common Logic
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
 How do we do this ?
 Many ways and most of them are well
known

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

This presentation
Focuses on two knowledge interchange
mechanisms
 KIF
 CL

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

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)

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

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

Syntax of KIF

Three layers

Characters-Basic characters of the
language
 Lexemes-Combination of characters
 Expressions-Grammatically legal
combination of lexemes
Characters

Classification of KIF characters
 Upper case letters
 Lower case letters
 Digits
 Alpha characters
 Special characters
 White space
 Other characters
Lexemes
Lexical analysis-Process of converting
characters into lexemes is called lexical
analysis
 Five types of lexemes in KIF

 Special lexemes
 Words
 Character references
 Character strings
 Character blocks
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 reference

 Charref :: = #\character
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 @
Lexemes-contd..

Operators-Form complex expressions of
various sorts
 Term Operators
 Sentence Operators
 Definition Operators

Constants- All other words





Object constants- Denote individual objects
Function constants-Functions on those objects
Relation constants-Denote Relations
Logical constants-True or False
NOTE: The differences between these
constants is only semantic not syntactic
Expressions

Three disjoint types of expressions
 Terms-Denote Objects
 Sentences-Express facts
 Definitions-Define constants
Forms- Definitions and sentences
 Knowledge base – Finite set of forms

Terms

9 Types









Individual variables
Constants
Character References
Character Strings
Character Blocks
Functional Terms
List Terms
Quotations
Logical Terms
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
Terms…contd
Quotations-involve the quote operator
and an arbitrary list expression
 Logical terms-involve the if and cond
operators

Sentences


BNF defines the set of legal sentences in KIF
6 Types of sentences
 Constants
 Equation –Consists of = and two terms
 Implicit 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
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
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.
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)
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 inferred
 For 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)))
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
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
Strings
List of characters
 Three ways to refer strings

 Enclose it in double quotes
 Use of character blocks by prefixing with #
 Using listof function(Useful because it allows
us to quantify over characters with strings)
KIF:Theoritical Problems

The formalization problem
 No general model theory for all constructs of
KIF
○ Hence, no rigorous general notion of meaning

KIF is developed before the emergence
of semantic web
 Not standardized
 Doesn’t follow XML-based paradigm
 Connections to RDF/OWL unclear
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.

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)
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
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 quantifier
 a 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.
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.
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

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
CL Model Theory

In CL’s model theory, everything is a
logical individual
 Only 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 n
 Cardinality
avoided
and
Well-foundedness
problems
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
Questions??