\documentclass[a4paper,12pt,twoside]{article}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This is the example Latex file for submissions to DL2000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%Since the layout for the articles in the DL2000 proceedings will be very similar
%to the one specified here, you can save time by simply using this file for your
%submission to DL2000.
%
%
%PLEASE NOTE that this example Latex file is not just a 
%simple LaTeX 12-point article style file as suggested for
%submissions to previous DL workshops.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 



\title{MKR - an English-like DL language}

\author{Richard H. McCullough\\
  Email: rhm@cdepot.net}
\date{}


%%%%%%%% PLEASE DO NOT CHANGE THE LAYOUT SPECIFIED BELOW %%%%%
%%%%%%%% Begin: Layout Instructions %%%%%%%%%%%%%%
\hoffset -1in
\voffset -1in
\oddsidemargin 3.2cm
\evensidemargin 3.3cm
\headheight 2.5cm
\textwidth14.3cm
\textheight21.5cm
\pagestyle{empty}
%%%%%%%% End: Layout Instructions %%%%%%%%%%%%%%%%



\begin{document}

\maketitle{}
\thispagestyle{empty}

\begin{abstract}

MKR is a very-high-level knowledge representation language
that is both English-like and UNIX-shell-like.
By design, MKR is a general purpose KR language that is
easy for humans to read and write.
MKR is an extended DL language.
Extensions relative to a typical Description Logic language
include:
	context,
	questions,
	methods,
	n-ary relations.

This paper introduces the MKR language,
describes some Semantic Web applications,
and relates MKR context to other context theories. 
\end{abstract}


\section{ Introduction }
Knowledge Representation is a life-long passion of mine.
In 1996, I designed my own KR language, which emphasizes
context, definitions, concept formation, easy reading and
writing by humans, and easy parsing by machines.
In 2002 and 2003, I changed the syntax to improve
the uniformity and generality of the MKR language,
and modified the MKE program [1] to facilitate
interoperability with the emerging W3C standards [2][3]
for the Semantic Web.

Concept formation "should" utilize only disjoint species,
but MKR permits non-disjoint species.  MKE detects such
"ambiguous" species as part of its consistency checks.

MKE is implemented in Unicon [4] and KornShell [5].
MKE is available for Linux and Windows, under the 
open source license: GNU GPL.

\section{ Hierarchy Relations }
Concept hierarchies are created, modified and searched
using regular-expression-style relations.  
The base relations are

\vskip 1 mm \hskip 5 mm	isu \hskip 5 mm unit,... isu primitive concept;
\vskip 1 mm \hskip 5 mm	iss \hskip 5 mm species,... iss genus concept;
\vskip 1 mm \hskip 5 mm isa \hskip 5 mm unit or species,... isa concept;
\vskip 1 mm and their inverses

\vskip 1 mm \hskip 5 mm isp \hskip 5 mm primitive concept isp unit,...;
\vskip 1 mm \hskip 5 mm isg \hskip 5 mm genus concept isg species,...;
\vskip 1 mm \hskip 5 mm isc \hskip 5 mm concept isc unit or species,...;
\vskip 2 mm
Note: "unit" is the term used in Rand [6],
which gives good definitions of "unit" and "concept".
The Description Logic Handbook [7] uses the term "individual".
Multi-level relations are expressed using the
regular-expression-style suffixes

\vskip 1 mm  \hskip 5 mm *   \hskip 8 mm zero or more levels
\vskip 1 mm  \hskip 5 mm +   \hskip 8 mm one or more levels
\vskip 1 mm  \hskip 5 mm **n \hskip 5 mm n levels
\vskip 2 mm
For example,
consider the "Implementation" access functions
described by McGuinness and Patel-Schneider [7]

\vskip 1 mm \hskip 5 mm (concept-descendents C)	     \hskip 10 mm  C isg* ?;
\vskip 1 mm \hskip 5 mm (concept-children C)	     \hskip 17 mm  C isg  ?;
\vskip 1 mm \hskip 5 mm (concept-ancestors C)	     \hskip 15 mm  C iss* ?;
\vskip 1 mm \hskip 5 mm (concept-parents C)	     \hskip 19 mm  C iss  ?;
\vskip 1 mm \hskip 5 mm (concept-instances C)	     \hskip 16 mm  C isp* ?;
\vskip 1 mm \hskip 5 mm (concept-direct-instances C) \hskip 5  mm  C isp  ?;
\vskip 2 mm
Complete hierarchies can be defined using a hierarchy group.
For example

\vskip 1 mm \hskip 5 mm	begin hierarchy ECP;
\vskip 1 mm \hskip 5 mm	existent;
\vskip 1 mm \hskip 5 mm	/   \hskip 5 mm entity;
\vskip 1 mm \hskip 5 mm	//	\hskip 10 mm man;
\vskip 1 mm \hskip 5 mm //	\hskip 10 mm group;
\vskip 1 mm \hskip 5 mm ///	    \hskip 15 mm enumeration;
\vskip 1 mm \hskip 5 mm ///	    \hskip 15 mm list;
\vskip 1 mm \hskip 5 mm ///	    \hskip 15 mm sequence;
\vskip 1 mm \hskip 5 mm ///	    \hskip 15 mm Set;
\vskip 1 mm \hskip 5 mm ///	    \hskip 15 mm multiset;
\vskip 1 mm \hskip 5 mm ///	    \hskip 15 mm LATTICE;
\vskip 1 mm \hskip 5 mm ////		\hskip 20 mm hierarchy;
\vskip 1 mm \hskip 5 mm ////		\hskip 20 mm lattice;
\vskip 1 mm \hskip 5 mm /   \hskip 5 mm characteristic;
\vskip 1 mm \hskip 5 mm //	\hskip 10 mm differentia;
\vskip 1 mm \hskip 5 mm //	\hskip 10 mm part;
\vskip 1 mm \hskip 5 mm //	\hskip 10 mm attribute;
\vskip 1 mm \hskip 5 mm //	\hskip 10 mm relation;
\vskip 1 mm \hskip 5 mm //	\hskip 10 mm action;
\vskip 1 mm \hskip 5 mm //	\hskip 10 mm interaction;
\vskip 1 mm \hskip 5 mm /   \hskip 5 mm proposition;
\vskip 1 mm \hskip 5 mm //	\hskip 10 mm context;
\vskip 1 mm \hskip 5 mm //	\hskip 10 mm sentence;
\vskip 1 mm \hskip 5 mm end hierarchy ECP;

\section{ Sentence Types }
The basic sentence types of MKR are

\vskip 1 mm \hskip 5 mm statement
\vskip 1 mm \hskip 5 mm question
\vskip 1 mm \hskip 5 mm command
\vskip 1 mm \hskip 5 mm assignment
\vskip 1 mm \hskip 5 mm conditional
\vskip 1 mm \hskip 5 mm iteration
\vskip 2 mm
Statements, questions and commands are discussed later.
Assignments have the format

\vskip 1 mm \hskip 5 mm set variable = value;
\vskip 1 mm \hskip 5 mm unset variable;
\vskip 2 mm
Conditionals have the format

\vskip 1 mm \hskip 5 mm if proposition list
\vskip 1 mm \hskip 5 mm then proposition list
\vskip 1 mm \hskip 5 mm else proposition list
\vskip 1 mm \hskip 5 mm fi;
\vskip 2 mm
Iterations use a "generator" statement to produce
a list of variable values.  For example

\vskip 1 mm \hskip 5 mm every p isa person \{
\vskip 1 mm \hskip 10 mm 	\$p has email = ?;
\vskip 1 mm \hskip 5 mm \};
\vskip 1 mm \hskip 5 mm every topic in knowledge representation,
\vskip 1 mm \hskip 15 mm 		description logic,
\vskip 1 mm \hskip 15 mm 		artificial intelligence \{
\vskip 1 mm \hskip 10 mm 	? has topic += \$topic;
\vskip 1 mm \hskip 5 mm \};


\section{ Statement Types }
The basic statement types of MKR are

\vskip 1 mm \hskip 5 mm definition
\vskip 1 mm \hskip 5 mm identity
\vskip 1 mm \hskip 5 mm binary relation
\vskip 1 mm \hskip 5 mm n-ary relation
\vskip 1 mm \hskip 5 mm part
\vskip 1 mm \hskip 5 mm attribute
\vskip 1 mm \hskip 5 mm action
\vskip 1 mm \hskip 5 mm interaction
\vskip 2 mm
Here are simple examples of each type

\vskip 1 mm \hskip 5 mm phonebook is relation with
\vskip 1 mm \hskip 10 mm     format = [person:1, phone:2],
\vskip 1 mm \hskip 10 mm     meaning = \{\$1 has phone = \$2;\};
\vskip 1 mm \hskip 5 mm man is person;
\vskip 1 mm \hskip 5 mm man isa entity;
\vskip 1 mm \hskip 5 mm Mary Doe isin phonebook = phonebook\_123;
\vskip 1 mm \hskip 5 mm knowledge haspart proposition list;
\vskip 1 mm \hskip 5 mm Tom, Dick, Harry has sex = male;
\vskip 1 mm \hskip 5 mm Sue do walk from her home to the store done;
\vskip 1 mm \hskip 5 mm smoking causes lung cancer;


\section{ Questions }
True-false questions are formed by wrapping statements 
with if and fi.  For example

\vskip 1 mm \hskip 5 mm if Mary Doe isin phonebook; fi;
\vskip 2 mm
Form-based questions replace one or more elements
of a statement or assignment by a question mark.  For example

\vskip 1 mm \hskip 5 mm ? has phone;
\vskip 1 mm \hskip 5 mm Sue do ? done;
\vskip 1 mm \hskip 5 mm ? is ?;
\vskip 1 mm \hskip 5 mm apple ? orange;
\vskip 1 mm \hskip 5 mm set charformat = ?;

\section { Commands and Methods }
Commands have the same format as action statements,
but with the subject omitted.  For example

\vskip 1 mm \hskip 5 mm do read from http://rhm.cdepot.net/kb/tabrasa.html done;
\vskip 2 mm
The output of commands (and other sentences) can be 
assigned to a variable.  For example

\vskip 1 mm \hskip 5 mm people := do ulist od person done;
\vskip 1 mm \hskip 5 mm males := ? has sex = male;
\vskip 2 mm
Methods are user-defined commands.
Methods are defined by a genus-differentia definition.
For example

\vskip 1 mm \hskip 5 mm read dmoz isa method with
\vskip 1 mm \hskip 10 mm     automatic = "isu",
\vskip 1 mm \hskip 10 mm     format = \{do read dmoz from directory:1 done;\},
\vskip 1 mm \hskip 10 mm     meaning = \{
\vskip 1 mm \hskip 15 mm 	do read from "\${1}/structure.rdf" done;
\vskip 1 mm \hskip 15 mm 	do read from "\${1}/terms.rdf" done;
\vskip 1 mm \hskip 15 mm 	do read from "\${1}/content.rdf" done;
\vskip 1 mm \hskip 10 mm     \};
\vskip 1 mm \hskip 5 mm do read dmoz from "\$kedb" done;
\vskip 2 mm
The automatic = "isu" specification generates the automatic declaration

\vskip 1 mm \hskip 5 mm \$1 isu directory;
\vskip 2 mm
The meaning of a method can be implemented as an MKR script
or a Unicon procedure.

\section{ n-ary Relations }
n-ary relations are defined by a genus-differentia definition,
and populated by a relation group.  For example

\vskip 1 mm \hskip 5 mm phonebook is relation with
\vskip 1 mm \hskip 10 mm 	format = [person:1, phone:2],
\vskip 1 mm \hskip 10 mm 	meaning = \{\$1 has phone = \$2;\};
\vskip 1 mm \hskip 5 mm begin relation phonebook;
\vskip 1 mm \hskip 5 mm John Doe, 555-1234;
\vskip 1 mm \hskip 5 mm Mary Doe, 555-5678;
\vskip 1 mm \hskip 5 mm end relation phonebook;
\vskip 2 mm
Since the automatic attribute defaults to "isa", the meaning
is augmented by the automatic declarations

\vskip 1 mm \hskip 5 mm John Doe isa person;
\vskip 1 mm \hskip 5 mm 555-1234 isa phone;
\vskip 1 mm \hskip 5 mm Mary Doe isa person;
\vskip 1 mm \hskip 5 mm 555-5678 isa phone;

\section{ Context }
The context of a proposition consists of a "view" attribute
which names a proposition list (in most cases, an equivalent
set of propositions can be determined), and "space", "time"
attributes which specify the "where" and "when" of actions.
For example

\vskip 1 mm \hskip 5 mm  at space = my house,
\vskip 1 mm \hskip 10 mm   time = any Saturday afternoon,
\vskip 1 mm \hskip 10 mm   view = weekend routine
\vskip 1 mm \hskip 5 mm  \{
\vskip 1 mm \hskip 10 mm    I do walk to the corner
\vskip 1 mm \hskip 10 mm	with purpose = get my snailmail
\vskip 1 mm \hskip 10 mm	done;
\vskip 1 mm \hskip 5 mm   \};
\vskip 2 mm
The propositions of a context are organized into an
entity-characteristic-proposition hierarchy which
supports efficient inferences and question answering.

\section{ Semantic Web Applications }
The Semantic Web is a natural application for the MKE/MKR
system.  I am cuurently working to make MKE/MKR interoperable
with systems using the RDF, OWL, and CycL languages.
MKE can already read simple RDF and OWL files, and
interfaces with the Stanford TAP KB [8]
and the ODP directories [9] used by Google [10].

\section{ MKR context and other context theories }
Although there are subtle differences, the MKR view
is roughly isomorphic to all of these contexts

\vskip 1 mm \hskip 5 mm OWL Ontology [3]
\vskip 1 mm \hskip 5 mm FCA context [11]
\vskip 1 mm \hskip 5 mm CycL Microtheory [12]
\vskip 1 mm \hskip 5 mm McCarthy context [13]
\vskip 1 mm \hskip 5 mm Devlin situation [14]
\vskip 2 mm
Note: MKR has no modal logic; it achieves the same
descriptive power using context.

\section{ References }
\begin{enumerate}
\item McCullough Knowledge Explorer and the MKR language,
http://rhm.cdepot.net/

\item Resource Description Framework,
http://www.w3.org/RDF/

\item OWL Web Ontology Language,
http://www.w3.org/2001/sw/WebOnt/

\item Clinton Jeffery, Shamim Mohamed, Ray Pereda, Robert Parlett,
"Programming with Unicon", draft manuscript, 2/21/2003.

\item Morris I. Bolsky, David G. Korn,
"The New KornShell Command and Programming Language",
Prentice Hall PTR, 1995.

\item Ayn Rand, "Introduction to Objectivist Epistemology",
Expanded Second Edition, Meridian, 1990.

\item Franz Baader, Diego Calvanese, Deborah L. McGuinness,
Peter F. Patel-Schneider, editors,
"The Description Logic Handbook", Cambridge University Press,
2003.

\item Stanford TAP KB, http://tap.stanford.edu/

\item Open Directory Project, http://dmoz.org/

\item Google, http://www.google.com/

\item Bernhard Ganter, Rudoff Wille,
"Formal Concept Analysis: Mathematical Foundations",
Springer-Verlag, 1999.

\item OpenCyc, http://www.opencyc.org/

\item John F. Sowa, "Knowledge Representation",
Brooks/Cole, 2000.

\item Keith Devlin, "Logic and Information",
Cambridge University Press, 1995.

\end{enumerate}

%\bibliography{your-bib-file}
%\bibliographystyle{plain}

\end{document}
