User:Rhmccullough/Sandbox/mKE

Definition
mKE is an intelligent, user-friendly computer program which helps its user to create, edit and search knowledge bases. It is intelligent because it knows its own abilities. It is user-friendly because it uses mKR as a user interface language.

ke properties
mKE is ke;
 * mKE is called ke.

ke isu OBJECT;
 * ke is a physical object

ke do ? done;
 * ke actions are user commands

ke has ?;
 * ke attributes are user options or variables

Example user interaction
echo := off;
 * turn off echo of input

debug := symbol;
 * turn on parse symbol debugging

Dick McCullough is array with mode = gdbm; Dick McCullough[email] := rhm@PioneerCA.com; Dick McCullough[phone] := 209-555-1212;
 * set GDBM mode for associative array

every attr of Dick McCullough; { do print od Dick McCullough[$attr] done; };
 * print array attributes

mKR scripts

 * cycexport cname (UNIX script)


 * # KEHOME/bin/cyc/cycexport
 * # Mar/30/2007 Jun/11/2008
 * # export OWL description of concept
 * # translate to mKR
 * # usage:
 * #      cycexport cname
 * cycdir="http://sw.cyc.com/2006/07/27/cyc"
 * mkrdir="$KEHOME/knowledge/cyc"
 * cd "$mkrdir"
 * cname="$1"
 * ##wget -O "$mkrdir/$cname.rdf" "$cycdir/$cname"
 * wget "$cycdir/$cname"
 * if [ -e "$mkrdir/$cname.owl" ]
 * then owl2mkr "$mkrdir/$cname.owl" "$mkrdir/$cname.mkr"
 * else echo "# ERROR: cycexport: cname <$cname> not found" >&2
 * fi
 * if [ -e "$mkrdir/$cname.owl" ]
 * then owl2mkr "$mkrdir/$cname.owl" "$mkrdir/$cname.mkr"
 * else echo "# ERROR: cycexport: cname <$cname> not found" >&2
 * fi


 * do.peirce (mKR script)


 * echo '<<<<< spo & owl CPS hierarchy >>>>>' >peirce.out
 * ke -m -owl <<\EOF >> peirce.out
 * ##echo := on;
 * ##UniqueName := shortname;
 * ##DisplayName := shortname;
 * categories:Symbol      is Symbol;
 * categories:Correlate   is Correlate;
 * categories:Deduction   is Deduction;
 * categories:Ground      is Ground;
 * categories:Hypothesis  is Hypothesis;
 * categories:Induction   is Induction;
 * categories:Interpretant is Interpretant;
 * do read from peirce.mkr done;
 * do print od "<<<<< ClassSet >>>>>" done;
 * ClassSet isall* ?;
 * do print od "<<<< >>>>" done;
 * every x ismem ClassSet; {
 * $x is ?;
 * };
 * do print od "<<<<< categories CPS hierarchy >>>>>" done;
 * Thing isc* ?;
 * do check od unknown done;
 * do print od "<<<< >>>>" done;
 * do simplify lattice od Thing done;
 * do print od "<<<<< simplified categories CPS hierarchy >>>>>" done;
 * Thing isc* ?;
 * do check od unknown done;
 * exit;
 * EOF
 * grep -v '^#' peirce.out | sed 's/^ *$//' | grep -v '^$' > peirce.ho
 * do print od "<<<< >>>>" done;
 * do simplify lattice od Thing done;
 * do print od "<<<<< simplified categories CPS hierarchy >>>>>" done;
 * Thing isc* ?;
 * do check od unknown done;
 * exit;
 * EOF
 * grep -v '^#' peirce.out | sed 's/^ *$//' | grep -v '^$' > peirce.ho
 * EOF
 * grep -v '^#' peirce.out | sed 's/^ *$//' | grep -v '^$' > peirce.ho
 * grep -v '^#' peirce.out | sed 's/^ *$//' | grep -v '^$' > peirce.ho
 * grep -v '^#' peirce.out | sed 's/^ *$//' | grep -v '^$' > peirce.ho

External References

 * http://mKRmKE.org/doc/MKEtutorial.html  mKR/mKE Tutorial
 * http://unicon.sourceforge.net/book/ut.pdf  Programming with Unicon