Home
        Case Mapper
         Contents
1.    FIRE supports a number of other case constructors  cf   6    but these three are useful for many  purposes     After you ve fetched cases  you can run SME  Alternatively  you can use the case as your probe for  MAC FAC  Both of these operations are discussed with examples below     9 23 2010    Using SME from within Case Mapper    We illustrate the use of SME via an example that uses the SME Classics     smoke kb     knowledge base   We will fetch two cases from the knowledge base and then browse an analogical mapping between the  cases  These cases are from the    Karla the Hawk    stimulus set described in  3      How to  Run SME    1  Open the    smoke kb    knowledge base  Structure Mapping Engine  SME    2  Fetch the case base 10  Base Case     KECaseFn base 10  z Run SME  3  Fetch the case ta 10  Target Case    KBCaseFn ta 10  v  Set Constraints  4  Select  KBCaseFn base 10  from the    SME Base Case dropdown list  and select Figure 5  SME is ready to run    KBCaseFn ta 10  from the SME Target  Case dropdown list  The SME frame of your window will resemble Figure 5    5  Click the Run SME button     If no message appears notifying you of a problem  SME has successfully computed analogical mappings  between the base and target cases  and the mappings are ready to be browsed  If the web browser  does not open automatically  press the Run SME button again     How to  Browse SME mappings    The SME browser opens automatically after running SME  The browser interface prov
2.   MatcherFn 1 0                    e Select a case from the Case Library list and Figure 12  Viewing MAC FAC results   click CV Compare to Probe  This will display  the content vectors of the probe and the selected case  as well as the dot product of the two  vectors  This dot product is used in the MAC stage of MAC FAC    e Click Run MAC FAC to see the results of the MAC and FAC stages of retrieval  The results are  displayedin the browser window  as shown in Figure 12  The results of the MAC stage are  shown first  listing the cases with the highest content vector dot product to the probe  These  cases are inputs to the FAC stage  which uses SME to find the most similar case s   The output s   of the FAC stage are listed under    MAC FAC Results     Figure 12      11    9 23 2010    Extending a knowledge base    For your own experiments  you may need to write your own cases  including defining new predicates     relations  and attributes  This section explains how to do this     How to  Write a case file    The file format supported by Case Mapper is the meld file  all files end in the extension  meld   You can    see some examples of meld files by looking in the samples folder that was included in your installation    of Case Mapper  Meld files are easy to write  with only a few simple rules                                    Each case must start with a case statement of the form  Case casename  where casename is the  name you would like to use toidentify your case    Fact
3.   Run MAC FAC    Once you have loaded and selected a probe and a case  library  discussed above   you may  MAC FAC Browsing    Reminding   reminding base 10 SyslitCaseLibrary  TheSet   sme  match   e Browse the given case library by clicking eres       Browse Library     Figure 9   This will open up  the KB browser and display the contents of the        selected case library  val SME Compare to Probe         Case Library  With Selected Case   SyslitCaseLibrary                            CV Compare to Probe  e Run MAC FAC by clicking    Do Reminding    Kp 3   Figure 9   If you select    Exclude probe from        results     MAC FAC will exclude the probe from   the case library when performing similarity  Figure 11  Running MAC FAC  based reminding  This is good practice     after   all  the most similar case to a probe is the probe itself     10    9 23 2010    Clicking    Do Reminding    will open a new browser MAC Results    window  with a display similar to Figure 11  which is    The following results are for the MAC stage only     the result of using the setup shown in Figure 9  From       Case   Value  here  you may take several actions  is 10  0 9415955  ma 10 0 91351354                      e Select a case from the Case Library list and MAC FAC Results  click SME Compare to Probe  This will open a    The following cases are FAC  analogy  output given the above MAC results        SME mapping browser  discussed above   ao  between the probe and the selected case  Is 10  
4.   lt correspondence  handle gt         correspondenceForTargetItem  lt mapping handle gt  electron  y   returns  correspondenceForTargetItem  lt mapping handle gt  electron  lt correspondence   handle gt         candidateInferenceOf  x  lt mapping handle gt      returns a list of  candidateInferenceOf  lt ci handle gt   lt mapping handle gt    items  where each   lt ci handle gt  can be used in the below Candidate infe rence level queries  These are analogical infe rences  from the base case to the target case      reverseCandidateInferenceOf  x  lt mapping handle gt      returns alist of  reverseCandidateInferenceOf  lt ci handle gt   lt mapping handle gt     items   where each  lt ci handle gt  can be used in the below candidate infe rence level queries  These are analogical  inferences from the target case to the base case     Correspondence level queries         correspondenceBaseItem  lt correspondence handle gt   x     returns the base item of the given  lt corres pondence handle gt          correspondenceTargetItem  lt correspondence handle gt   x     returns the target item of the given  lt correspondence handle gt      Candidate inference level queries      candidateInferenceContent  lt ci handle gt   x          returns the fact form of the given  lt ci handle gt  in the mapping      supportScoreOf  lt ci handle gt   x     returns the support score of the corresponding candidate inference      extrapolationScoreOf  lt ci handle gt   x       returns the extrapolation 
5.  3  high  Expression correspondences are facts that correspond    3  pace  between the base and target cases  You can browse these by    2  pleasure  clicking the expression correspondences link while browsing  e 12 candidate inferences  a mapping  These expression correspondences are what e 49 expression correspondences  suggest the entity correspondences  Moreover  since score e 31 functor correspondences      trickles down    to the arguments of a correspondence  the Legend   i i        Match     Expression     Candidate  expression correspondences provide support for the entity fasion EEE se  correspondences  such that those entities which participate Details Explanation    in large relational structures get higher scores  i      Figure 7  Browsing a SME mapping     It is important to understand that there is a translation   process that occurs when facts are added to an SME description  Recall that in structure  mapping  theory  there is a sharp distinction between attributes  which are unary predicates on entities  and  relations  which have two or more arguments  This is a psychologically important distinction  In Cyc   style knowledge bases  attributes are implemented via collections  Instances are related to collections  via isa statements  i e       isa Nero Cat     This says that Nero is a Cat  i e   the individual Nero is aninstance of the collection Cat  It is logically  equivalent to the attribute form that SME expects  i e       Cat Nero     9 23 2010    Case M
6.  KB  corruption  So unless you are replacing a previous backup  creating a new directory is almost always  what youwant todo  Should you need to use your backup  the command    Restore KB from Backup      also on the KB menu  can be used to replace the contents of a KB with the backup     The smoke test KB is tiny  requiring only around 10 MB of storage  The OpenCyc derived KB requires  less than 2GB of storage     How to  Open a Knowledge Base       Once Case Mapper is open  your window should look similar    Select a KB Directory  2     to Figu re 1  Select the directory of the knowledge base you  wish to use     1  Open the KB menu  and click Open KB   2  Navigate to the directory where your KBs are stored   by default  it s C  QRG KBs    and select a KB by TTS PRP                z  selecting the directory of the KB you wish to use  e g  ia weet       smoke kb or opencyc kb   as in Figure 2  and then te ig PASSED   click OK  fr ORG KBs 5        f   opencyc kb  3  Case Mapper will display the current KB the L   gt   477 QRG SS a    Knowledge Base  KB  field  CAGRG KBs smoke ko OK          Once a KB is open  you can browse and edit the KB  click    Browse KB in the KB menu   add new knowledge to the KB dg de a KB     2  www opencyc org    9 23 2010    with meld files  discussed below   or fetch cases for use with SME and MAC FAC  To change KBs  click  Close KB in the KB menu  and open another as described above     How to  Browse a Knowledge Base    Case Mapper allows you to
7.  browse the knowledge base in a web browser     After you open a KB  the  menu command Browse KB in the KB menu will automatically open your browser to the correct  address   Sometimes this process can be cranky  since communicating with browsers from other  software isn   t always smooth  If the browser contents haven t changed within 30 seconds  press the  button again  after starting a fresh copy of the web browser      The browserinterface allows you to search for terms in the KB and manually remove or forget facts  from cases in the KB  Searching is easy  enter a search term  or the beginning of a search term  i e     bas     will bring up concepts such as BasalNucleus  BaseballDiamond  Bassoon  etc       Warning  Searching with a small search string  e g     b     in a large KB  e g  OpenCyc  on a slow  computer  e g  a laptop  may take a very long time to complete  It   s better to search with a  more specific term and use the links in the concept descriptions  discussed below  to navigate    when possible                     Clicking a concept displays its information  Clicking on    BaseballDiamond   OpenCyc KB  BaseballDiamond concept within the OpenCyc KB browser lype  Collection   C GRGWplanbinstopeneye KbA  will show a concept screen similar to Figure 3  med  BaseballDiamond is a Collection  as noted in the header  and SpatiallyDisjointObjectType  it   s a subtype of  i e   it genls to  AthleticField  You may click  in universaivocabutarymt  AthieticField  both C
8.  fact by evaluating   send test msg     forget  fact  isa America  country   context cm test case     Note that you need not retrieve facts before  forgetting them  we did this purely for demonstrative purposes    8  Verify that the fact was properly deleted from the KB by refreshing your KB browser window     16    9 23 2010    Next  we discuss how to run SME using KQML ask messages     1  If you are starting a new Case Mapper or Lisp IDE session  complete steps 1 3 above     2  In your IDE  evaluate   send test msg    ask  query  matchBetween   ExplicitCaseFn solar system         ExplicitCaseFn rutherford atom    TheSet   match         3  Case Mapper s response message should include the content       ist Information EverythingPSC     matchBetween  ExplicitCaseFn solar system            ExplicitCaseFn rutherford atom    TheSet   MatcherFn 7 0        Note  your  MatcherFn 7 0  term may differ in numerical arguments  this is only an internal  identifier token that serves as a handle for getting further information about this SME  operation  while it is still resident in Case Mapper s working memory    4  Using the MatcherFn term you received back from Case Mapper  here   MatcherFn 7 0     you can perform the following ask queries to obtain data about this SME analogy operation   Just put the following lisp forms into the  query argument of send test msg     Match level queries      numberOfMappings  lt matcher handle gt   x     returns the total number of mappings computed  h
9.  handling  contradictory data and maintaining case based knowledge granularity     How to  Use KQML to Retrieve    Retrieving is the act of finding facts within Case Mapper s KB  bypassing Case Mapper s reasoning  functionality and working memory  You can create a retrieve message by replacing the   content field    15    9 23 2010    of the above packet with  retrieve  pattern  lt query gt   context  lt context gt    The contextis  an optional argument for specifying the logical KB context to perform the retrieve     How to  Use KQML to Forget    Forgetting is the act of removing a fact from a logical context in Case Mapper s KB  Because knowledge  is contextualized  forgetting a fact in one context will not affect the presence of a fact in another  context  You can create a forget message by replacing the   content field of the above packet with   forget  fact  lt fact gt   context  lt context gt    The context is a required argument for specifying  the logical context in the KB inside which the fact will be forgotten  If the factis not present in the given  context  no action will be taken     Using the test client Isp client example    This section assumes you have a Common Lisp IDE installed  Also note that this section uses certain  cases within the    smoke kb     but the same methods apply for any case in any Case Mapper compatible  knowledge base     1  Start Case Mapper  open the    smoke kb     and start your KQML server on some port   Compile and load the test die
10.  i     SyslitCaseLibrary v Do Remindi  be any existing or dynamically created case  and oo BETTE    Browse Library       2  a case library  which is a set of persistent cases  in the KB  You can use Case Mapper to select a  probe and a case library  and run MAC FAC  transparently  You may select a probe by fetching a case from the KB  as discussed above  In the  following  we discuss the processes of loading a case library and running MAC FAC     Figure 9  MAC FAC in Case Mapper    How to  Fetch a Case Library    A case library is a set of cases  A single KB can contain many case libraries  Case libraries may be    fetched directly from your KB in a similar fashion as cases are fetched  as discussed above  The KB must  be open before fetching case libraries              Load Data from KB  3   Case Library Name  To fetch a case library from the KB  sys a  Corresponding data in KB  1  Under the File menu  dick Fetch Case  then Fetch Case SysitCaselibrary  SyslitCaseLibrary 12  Library  A pop up dialog will appear  Figure 10   SysitCaseLbrary5  2  Locate the case library by typing part of the case library   s  name  and click Search KB  Note  If you are using the smoke   kb  there are several pre existing case libraries  asin Figure 10   3  Click the desired case library and click Load  are  zj  The fetched case library will now be present in the Case Library drop                 down list  within the MAC FAC interface  Figure 9      Figure 10  Case Library fetch dialog   How to
11. 9 23 2010       Case Mapper    User Manual    Scott Friedman  Ken Forbus    Qualitative Reasoning Group    Northwestern University    9 23 2010    Contents  OE TE EEE TE EE EE EE SE ME He E 3  Knowledge Bases and Casesiic  ciecccsideciscisescecsetesvesdbcessececcnsdesdesoesedeuaced dassesscencesssedbewssscevonsdecboeseedbeessss 3  How to  Back up a knowledge base            cccccececcccsseseseeececeseaueaeeseececeseaueucesececessaueaseeseeeesessauaaeeseess 4  How to  Open a Knowledge Base      rrrrrrvnrrnrnnnnnrrrvrnrrvnnnsnnrrrvnvnrrnnnnsnerssnrnnnnnnnsnersrnnvnrnnnnnsnanssnrsnnnnnnsssee 4  How to  Browse a Knowledge Base              cccccccccccsseseseeececeseauensseseeceeeeeaueasseseceeeseaueaseseeeeeessaueasesees 5  How to  Fetch a Case vansdnsasdated daaeanavauagshasacabenc dex  absotaeiass deus ees sageatan Shel ves souee teed lecttathedoe dikte 5  Using SME from within Case Mapper          cccccsssccccesssececeeesceceeeeececeaeeeceeeeeeeceeeaeeceeesaeeceeeeasceeeaaeeeeesaaases 7  HOw  tO  RUM SME uva2422vpareL N 7  How to  Browse SME Mappings              cceeceeeeeceeeee cence ee eeeaeeeeaaeeeeaeeeaaeseaaeecaeeeaaeeeeaaeeeaeeeaaeeeeaeeeaeeeeae   7  How to  Constram SME  xuxs ordskifte 9  Using MAC FAC from within Case Mapper     rarnvnnnvnvnnnnnnnnnnnnnnnnnnnennnnnnnnnennnnnnnenenenenenennsnenenensnenenenenenerer 10  How to  Fetch a Case LiDrary         ccccccscssessseeeecececeueeeeeccceceassuseeeeeeeeecesssseseeceeeseaseaeseseseeeeseauanseseeess 10  How to  Run MAC F
12. AC    rarannnnnvvvrnnnnnnnnnnnnrrnnnnnannnenserrnnnnnnsnenenserrvvanenennnrrvvnnnnnnenennnrnvvnnnnnnenenensevvnnnnnr 10  Extending a knowledge base Li suusvasnsslvasnssevdesekedaedeksevadespedgoassksedansnssengaesserdotekssdadensendast eksosen skandidsdk  e 12  HOW to  Write a case file x  siisevsssssesnvocecasersdnenseenssnaesaanendeis Ghee S Eana AE ARAE EEEE D EANTA ESERE 12  How to  Define new predicates and CONcCeptS     rrrrrrrrarnnnnnrrrrrvrvrnrnnrrrrnrrrnrnnenersrsrnrsrnrnnnnsssrssnrsrrsnnnnen 13  How to  Load a case file into your knowledge base             cessesseseeecececeseeeseseeceeeseaueaseseeeeeeseauenseseeess 14  SOM EE GR 14  How to  Start  amp  Stop the KQML Servel          cccccccccsssseseeeececceaueaseeseeceeeeeaseaseeseeeecessueeseseeeeeeasauanseeess 14  Basic KOML  amp  Packet Structtires      sai5se0 ceassceenonchennsival san sawevanevenaveusssuevaae  syersvevaybeessvessiasevedbvese  eesene 14  How to  Use MOMLtOASK i  ccsiaiasxsensdvaivsun tans cnansns even sdssbiws save vewsesys veda day Sbeedvabeoenesg sees dvd vberceseseneszovtets 15  How to  Use  KOMLtO Store ics  casssccccgee tec cdievececin voewcuenstee td ENEE N EEN SEOANE N EENES ENESE AES 15  How to  Use KOML to Retrieve  cis ccccssecvcecucesiececnetececesseeecueeseeetcnseeseuuesveetuessceetaeeeececuesesseconsseetcuevsees 15  How to  Use KOML to Forgets  casis   ccs cccasascsitsa coded shuncedeascadsetes canada a a a Era aa spades aaar aana E aE banet 16  Using the test client Isp clientexamp
13. a    smoke test      which ensures that FIREis operating correctly     9 23 2010    e OpenCyc derived    opencyc kb  directory  This KB contains contents we extracted from  the OpenCyc knowledge base  OpenCycis a freely available  version of the Cyc knowledge base   which is currently the largest and most comprehensive formally represented knowledge base in  the world  We do not use Cycorp   s reasoning engine  since our FIRE reasoning engine is  optimized for analogical operations  The subset of OpenCyc concepts we extracted currently  contains just over 1 3M facts  58K concepts  14K relations  and 3K functions     You will find that some operations are much faster with the SME classics KB  although there is much  more knowledge in the OpenCyc KB     How to  Back up a knowledge base    Things can go wrong with any program  and more so with research software  We strongly recommend  backing up your KBs before doing anything else with Case Mapper   In the worst case  you can always  reinstall Case Mapper  but that takes even longer   Once you open a KB  discussed next   you can back it  up for later use  The command to use is on the KB menu  Create KB Backup  It will ask you for a  directory to place the backupin  You can choose any directory you like  e g  a USB flash drive   and the  backup dialog lets you type in the name of a new subdirectory along that path which should be used   The backup process deletes anything thatis already in the directory that you give it  to avoid
14. able concept already exists   and hence you don   t have to define a redundant one   To do this  finda relevant concept that is a  superclass of your concept  let   s say  lt super gt   andincludein your file    genls  lt new gt   lt super gt      You can have multiple genls statements concerning a concept in your file  of course     In Cyc derived KBs  the convention is that relations start with lower case letters and are camel cased     e g   connectedTo   functions start with an upper case letter and have    Fn    on the end  e g            FruitFn   and attributes start with an upper case letter  e g   BiologicalSpecies   In the SME  Classics KB  predicates  functions  and attributes are all lower cased  with hyphens used to split terms  instead of camel casing  Case Mapper does not enforce these conventions  but you will very likely find it    useful to stick with them when possible     Generally you will find it useful to create a new meld file with the specifications for your new predicates  and attributes  separate from the meld files for whatever cases use them  To indicate that these are    background facts  include at the start of the file the declaration     in microtheory UniversalVocabularyMt        This will make your new information accessible from every case     4    You can learn more about emacs online at http   www gnu org software emacs      13    9 23 2010    How to  Load a case file into your knowledge base    If you have knowledge in a meld file that y
15. apper automatically translates between these two forms as needed  When you see a casein the  KB browser  you will see isa statements being used  whereas when you see the same case in the SME or  MAC FAC results browser  you will see itin the attribute form     For more information on SME  induding a discussion of its algorithm and more in depth explanation of  the terms discussed above  see  1      How to  Constrain SME    By default  SME will produce the best structural mapping  or up to three  if the others are very close  for  the given base and target  However  sometimes the context for analogical reasoning provides more  constraints that need to be respected  In understanding an explanatory analogy  for example  the  context provides explicit constraints that some entities must match  e g      An atomis like the solar  system    means that atom and solar system must correspond   In analyzing a complex analogy  several  iterations of mapping can be required  e g   1    so SME must be told to avoid certain correspondences   to force it to look for alternatives  Case Mapper provides an interface for adding and removing such  constraints  To illustrate  let us consider a variation of the mapping we just used     1  Fetch cases base 10 and ta 10 from the smoke kb KB   Select  KBCaseFn base 10  as the SME base  and select  KBCaseFn ta 10  as the SME  target  The SME frame of your window will resemble Figure 5    3  Click Set Constraints    4  Select Ivan from the entitiesin th
16. e base  and                MEN  Ah   SME Constraints   KBCaseFn base 10     KBCaseFn ta 10  Eg  select Christine from the entities in the target   i Aad 5 The Structure Mapping Engine can constrain its mappings in a number of ways   5  Select  Selected entities must NOT correspond These controls allow you to manipulate a subset of these constraints for the  mappings between base and target   from the Available constraints dropdown list  Available constraints         Selected entiti t NOT nd v Add  and click Add  The constraint popup should look E    Current constraints   like Figu re 8  Ivan and Christine must NOT correspond   6  Click Done  then click Run SME and browse the  i i  resulting SME mappings  Remove Selected  Entities  In Base   KBCaseFn base 10  In Target   KBCaseFn ta 10     The SME browser will display the constraint we just  added  in addition to any other constraints you ve             added   In this case  the mapping suffered a score st high   decrease due to the constraint  If you browse the mn pleasure   mapping  you ll notice that Ivan and Christine are not   included in the entity correspondences  which also Done   canal            prevents many of the expression correspondences from    ED p   i Figure 8  Constraining SME   participating in the mapping     9 23 2010    Using MAC FAC from within Case Mapper                MAC FAC is a model of similarity based retrieval  MAC FAC Reminding a  The inputs to MAC FAC are  1  a probe  which can   P     3 NG  
17. edge bases  using SME  using MAC FAC  and troubleshooting  Forinformation  about the algorithms behind these cognitive models and related experiments  please see the following  references   5 1 3   These can be found on the QRG web site  at www qrg northwestern edu     In learning Case Mapper  we suggest that you work through the examples in the order provided in the  manual     Knowledge Bases and Cases    Case Mapper is always used with a knowledge base  KB   The KB stores knowledge  induding facts and  cases  Cases are simply collections of facts that can be treated as a unit   Inside the KB  cases are  implemented via Cyc style microtheories  Sometimes browsing tools will refer to microtheories  and  that   s what they mean  You can just think of them as cases   Some facts in the KB specify properties of  the vocabulary of predicates it uses  including their arity  number of arguments   whether they are a  relation or a logical function  and what types of arguments they can take  Other facts in the KB spedfy  properties of the concepts in the KB  collections in Cyc terminology  SME and MAC FAC require this  information for any predicate used in cases  The Case Mapper distribution comes with two knowledge  bases     e SME Classics    smoke kb  directory     This KB contains predicate spedfications and cases  from many of the early published SME and MAC FAC experiments     1 The    smoke kb    designationis because this KBis generated as part of the FIRE regression test  ak
18. ere   x   2       bestMapping  lt matcher handle gt   x      returns a handle to the best mapping  here   x   MappingFn 9  MatcherFn 7 0        Once you have a handle to a mapping  you can use the following mapping level queries     Mapping level queries      numberOfCorrespondences  lt mapping handle gt   x       returns the total number of correspondences in the mapping  here   x   11       numberOfCandidateInferences  lt mapping handle gt   x       returns the total number of candidate inferences in the mapping  here   x   3          structuralEvaluationScoreOf  lt mapping handle gt   x       returns the structural evaluation score of the mapping  here   x   0 1657     correspondsInMapping  lt mapping handle gt   x  y     returns a list of  x  base  and  y  target  correspondences in the given mapping  for example      correspondsInMapping  MappingFn 9  MatcherFn 7 0   planet electron      hasCorrespondence  lt mapping handle gt   x       returns a list of correspondence handles for all correspondences in the mapping  for example     17    9 23 2010     MhFn 1  MatcherFn 7 0    Thisisintheform  MhFn  lt index gt   lt matcher handle gt    where  Mh stands for Match Hypothesis  Once you have correspondence handles  you can ask  correspondence level queries  Similarly  the next two queries produces correspondence handles      correspondenceForBaseItem  lt mapping handle gt  planet  y          returns a list of the form  correspondenceForBaseItem  lt mapping handle gt  planet 
19. ides an interactive  report on the mappings that SME generated from the two representations  Browsing SME does not   affect the mappings that were generated  this is just a  manner of inspecting various details of SME   s output  Seuk  We ll start with the initial page  as shown in Figure 6     which results from following the instructions in the last    Base   KBCaseFn base 10           section   Target   KBCaseFn ta 10   The SME number  12 in Figure 6  and the Mapping       score   mHs    cls  Mapping 65   13 4654 87  12                number  65 in Figure 6  will likely differ from your    s ape          e 16 entity correspondences  results  these are identifiers used to differentiate various x    i  e 144 expression correspondences    SME instances and mappings  If you constrained SME e 34 functor correspondences                 as we do in the next example   your constraints appear  Figure 6  Browsing SME     on this page as well   Clicking the Base or the Target case names will let you browse the facts in each representation  Clicking  on any of the mappings will provide more information about that analogical mapping  Note that SME  may compute multiple mappings  and in some cases  no mappings  These are not errors    the number  and content of mappings is a function of  a  the constraints placed on SME  which we discuss below   b   the parameters of SME  also discussed below  and  c  the facts in the base and target cases        9 23 2010    Click on the mapping to bro
20. ing and stopping the server  The status label will change based  on the status of the server     Once you have started a server  you can use a client program written in the programming language of  your choice to communicate with Case Mapper and use the knowledge base  the built in reasoner  and  SME     Basic KQML  amp  Packet Structure    Client programs can be writtenin any language  permitted that they can open a TCP IP socket to the  computer running Case Mapper  Case Mapper allows a subset the standard KQML interactions  so we  can review them in their entirety  The following string is a valid KQML packet that sends the content   ask  query  isa  x Dog    to Case Mapper       tell  sender  localhost    receiver  localhost    in reply to      reply with  MSG 42     language      ontology       14    9 23 2010     content  ask  query  isa  x Dog       Note that all of the keyword fields  except for   content  are spedfied by character strings  and the  packet must contain quote     characters around these parameters  Conveniently  you can use the  above packet structure and substitute only the parameters for   reply with and   content to  programmatically access Case Mapper     The Case Mapper server accepts these packets in string format  and its response packets are in the same  format  Note that the Case Mapper server socket connection is not persistent withits clients  soit  disconnects each time a packet is processed  after a response packet is sent back to the sende
21. le             ccccccccsseseececeesececeeecececeeeeeeaeeseecesaeseceseeceeesaeseeeeeaaeees 16  Troubleshooting Case Mapper          ccccccssscecccseseececeseeceseeeeeesaeeeeesaeneeeeseeeeeesseeceeeseeeeeeesaeeeeesaeeeesaanees 19  Refere NCES diedar sas aeaaea e anaa aea e aa aaa aaa aaa aaa band avesadevaessaessaeaistsdansataneyeaae as 19    9 23 2010                            Overview   Case Mapper provides an interface for using PO ORG  Case Mapper  Beta  eee  computational models of structure mapping Se   theory  5   The Structure Mapping Engine  SME  No KB is currently open     1  models analogical matching  MAC FAC  3  Structure Mapping Engine  SME     models similarity based retrieval  These are Bae ase    4  embedded in the FIRE reasoning engine  4   which pe   provides a knowledge base infrastructure and MAC FAC Reminding zj  various reasoning facilities  Case Mapperis Exobe  ar   designed for cognitive scientists  This means we Foer Pi  assume some familiarity with knowledge EEA          representation  predicate calculus and analogical  reasoning  but we do not assume any Figure 1  Case Mapper is open for business   programming skills on your part  Being research software  Case Mapper is a bit fussier than a  commercial application  butit is software our group uses daily in a variety of systems  hence the internal    operations are quite robust     This manual describes how to operate Case Mapper  Specifically  it covers browsing and editing  knowledge  using knowl
22. ng a lot of time elsewhere  In the latter case  try again    When you get an unrecoverable error dialog  if you click on    debug    instead of    ok     the  program will in some circumstances keep going just fine  However  you should save your KB  soon  and be sure to have a backup handy just in case    If you have difficulty starting or connecting to the Case Mapper KQML server  ensure that your  Windows firewall is disabled  at least for the port you have specified as your KQML server port     References   1  Falkenhainer  B   1987   An examination of the third stage in the analogy process  Verification   based analogicalleaming  In Proceedings of UCAI 87  Los Altos  Morgan Kaufmann    2  Falkenhainer  B   Forbus  K  and Gentner  D   1989   The Structure Mapping Engine  Algorithm  and examples  Artificial Intelligence  41  1 63    3  Forbus  K   Gentner  D   and Law  K   1995   MAC FAC  A model of similarity based retrieval   Cognitive Science  19  141 205    4  Forbus  K   Hinrichs  T   de Kleer  Usher  J   J   Klenk  M   Lovett  A   and Paritosh  P    unpublished  The FIRE Manual    5  Gentner  D   1983   Structure mapping  A theoretical framework for analogy  Cognitive Science   7  155 170    6  Mostek  T   Forbus  K  and Meverden  C   2000   Dynamic case creation and expansion for    analogical reasoning  Proceedings of AAAI 2000  Austin  TX     19    
23. nt Isp file    In your IDE  evaluate   make test client  localhost  4444   but substitute 4444 for  the port you chose  This creates and binds a persistent client object for this server port  combination    4  In your IDE  evaluate   send test msg    ask  query  isa  x harmful     This splices  the lisp form  ask  query  isa  x harmful    into the  content argument of anew  KQML message and sends it to Case Mapper  The outgoing message and response message  should be printed in the IDE window  and the function should retum the content from the  response message  which contains Case Mapper   s response to the ask query  Note that the  term  xis considered a variable by Case Mapper s internal reasoner  since it is proceeded by a  question mark  Any such   5  In your IDE  evaluate the following   send test msg     store  fact  isa America  country   context cm test case    This stores the fact  isa America country  in  the KB  in a microtheory  contextual case  called cm test case  If the context cm test   case did notexist beforehand  Case Mapper creates it    6  Verify that the fact was properly stored by browsing the KB via the KB menu  and searching for  cm test case  You ll notice that there is one fact in the microtheory    the one we just stored  programmatically using our KQML client    7  Retrieve the case by evaluating   send test msg     retrieve  pattern  isa America  country   context cm test case     note that the  context keyword is optional here    and forget the
24. ollection and AthleticField to learn more about both SSaqjQQ__U_U  jQcC    be  ee       Knowledge Base  C  QRG planbikbs opencyc kb OpenCyc KB 9 18 2009  concepts     this is an effident manner of navigating the    knowledge base  Figure 3  Browsing a KB concept     To the left of the main frame  you may browse all the other genls and specs of the concept  as well as  retrieve all references of the concept in the entire KB  Retrieving all references may take a very long  time if there are alot of them  For example  there are over a half million i sa statements in the KB  so  retrieving all of them is rather time consuming  and can even lead to errors  see Troubleshooting      How to  Fetch a Case    A case is a set of facts  Consequently  a case can represent an experience  a stimulus  a collection of  domain knowledge  a theory  a story  or any other set of knowledge  Pre existing cases may be fetched  directly from your KB or new cases can be automatically constructed from portions of the knowledge  base  e g   what the system knows about the Hawaiian Islands  using case constructors  The KB must be  open before fetching cases      gt We routinely use Internet Explorer and Firefox  We have not systematically tested our code with other web  browsers     9 23 2010    To fetch an existing case from the KB     1  Under the File menu  dick Fetch Case  then Fetch Load Data from KB a  Existing Case  A pop up dialog will appear  Figure 4   Case Name  2  Locate the case by typing pa
25. ou want to use with SME or MAC FAG  you must load it into  your KB  To load a meld file into your KB  first ensure that you have a KB open and then choose Load  File  gt  Import  meld file from the File menu     KQML Server    Case Mapper comes with a built in server module  so that other applications and cognitive models can  access SME  MAC FAC  and knowledge base programmatically  Also included is an example dient  application in the file test client Isp  This is a Common Lisp implementation of a stand alone program  that sends and receives KQML  Knowledge Query Manipulation Language  packets to the Case Mapper  server  Importantly  the KQML server interface of Case Mapper can communicate with client programs  written in any programming language  provided they can open sockets and send properly formatted  KQML messages  KQML based interaction with Case Mapper involves four types of interactions   1   Knowledge Base store   2  Knowledge Base retrieve   3  Knowledge Base forget  and  4  ask  Next  we  discuss how to start and stop the KQML server  and we review KQML packet structure and specifics  including each of these four interactions     How to  Start  amp  Stop the KQML Server    KQML Server    On the bottom of the Case Mapper  PP Status  No KQML server is active  Port   4444        interface is a KQML Server panel  This   panel shows the status of the server  and contains Port field for entering the server port of your server   default is 4444   and a button for start
26. r  In the  following subsections  we describe each interaction and packet  Note that only the   content field  changes for each of the interactions     How to  Use KQML to Ask    The above packet example with content  ask  query  isa  x Dog   performs an ask operation on  the Case Mapper server with the query   Consequently  Case Mapper will use its working memory and  its KB to find all possible answers to the asked query    in this case  it will bind the variable  x to all  known instances of the collection Dog  The response will look something like this       tell  sender  localhost    receiver  localhost    in reply to  MSG  2    reply with  MSG  2     language      ontology       content   ist Information EverythingPSC  isa Bluto Dog     isa Dash VictoriasPet Dog     isa HYP Dog 5968235 Dog       isa  GenericInstanceFn Dog  Dog        ist Information EverythingPSC  ist Information EverythingPSC                     ist Information EverythingPSC    The SME and MAC FAC functions are accessible programmatically via ask messages  We discuss this in  further detail below     How to  Use KQML to Store    Storing is the act of inserting new facts into Case Mapper s KB  You can create a store message by  replacing the   content field of the above packet with  store  fact  lt fact gt   context   lt context gt    The context is a required argument for specifying the logical context in the KB inside  which the fact will be stored  Contextualizing knowledge in the KB is important for
27. rt of the case   s name  and  es  Search    click Search KB  hin nn    3  Click the desired case and click Load  senter  4  The case name is now added to the Base Case  Target pens  Case  and Probe drop down lists in the main window  Pt  bose 8  The example in Figure 4 is using the smoke test KB  and the  BasekB    base stories are from the Karla the Hawk story set  3               Case Construction Style                 KBCaseFn    One can also dynamically generate cases from the contents of      Load   Cancel    the knowledge base  To fetch an entity or collection case from L      the KB  Figure 4  The case loader popup dialog   1  Underthe File menu  dick Fetch Case  then Fetch    A i UWwWN    Entity Case or Fetch Collection Case  A pop up dialog will appear  Figure 4      Locate the entity or collection name in the KB by typing part of its name  and click Search KB   Click the desired entity or collection     Choose your desired case construction style  discussed later   and then click Load     The case name is now added to the Base Case  Target Case  and Probe drop down lists in the  main window     There are three KB constructors that are built into Case Mapper currently  They are     3     MinimalCaseFn  Retrieves the set of facts in the KB that mention the entity or collection     CaseFn  Like MinimalCaseFn  except that it includes attribute information for every entity  mentioned in the case     CleanCaseFn  Like CaseFn  except that redundant attributes are removed  
28. s following a case statement are stored within that case    You can have multiple cases in one file     as long as each case has a separate case statement   Everything between the first case statement and the second case statement is a fact that  belongs to the first case and so on     Case Bobl   isa Bob Dog                 relationExistsExists loves Person Dog   animalTypeMakesSoundType Dog BarkingSound        relationInstanceExists anatomicalParts  GenericInstanceFn Dog  Mouth     Case Bob2   isa Bobby Cat   relationExistsExists loves Person Cat                    relationInstanceExists anatomicalParts  GenericInstanceFn Cat  Mouth        Figure 11  A simple meld file containing two cases  Bob1 and Bob2  Each case contains a list of facts     You can write a case file using any text editor that you are comfortable with  just make sure to save your  file as filename meld  Three important points     1     2     3     It is important that your text editor produce plain text files  often called ASCII files or     txt    files   in Save As menus   since formatted files  like  doc   html  or  pdf  will not be correctly handled by  Case Mappers load routines    Your case must use concepts and relations that are definedin the knowledge base for SME and  MAC FAC to work properly  You can find appropriate pre existing concepts by using the KB  browser  If you need to define your own  please see the next section    To make editing a little easier  you might want to use a text editor 
29. score of the corresponding candidate inference      candidateInferenceCorrespondences  lt ci handle gt   x          returns a set of correspondence handles representing the correspondences  match hypotheses     that support the given candidate inference     18    9 23 2010    We have demonstrated how to use SME via Case Mapper   s KQML server with a Common Lisp client  however  all    of these queries can be performed by other programs written in other languages  provided they use the same    KQML message structure and query syntax as discussed above     Troubleshooting Case Mapper    When you start the KB Browser or try to browse SME or MAC FAC results for the first time  you  may get a Windows Firewall pop up dialog that asks you whether or not you want to allow Case  Mapper to communicate  It isimportant that you choose    unblock     since otherwise the  program will not be able to communicate with the browser    If you get a dialog box that says    unrecoverable error    when opening a KB  it means that either  there isn   t a KB at the location you selected or itis corrupted  Delete whatever files are at that  location  and restore your KB from the backup you made    If you are browsing and you get something that says    Lisp error    instead of what you expected   then you hit a time out in the browsing system  Either the operation is just too big for the  browsing system to handle  e g   showing all isa statements in the OpenCyc derived KB  or  your machine was spendi
30. that will match your  parentheses for you  this means making sure that there are equal numbers of right and left    12    9 23 2010    parentheses   If your file has mismatched parentheses it will not loadin Case Mapper  We  recommend Emacs  a freely available text editor        How to  Define new predicates and concepts    To define a new predicate  you must spedfy several things via facts in meld files     1     Is it a relation or a function  Ifit is a relation  then you should include the statement     isa  lt new gt  Relation    in your file  If itis a logical function  then include    isa  lt new gt  Function Denotational    The collections Relationand Function Denotational are used by the KB SME interface to  determine whether something is a relation or a function  The minimum additional information that SME  needs is its arity  number of arguments   For fixed arity relations or functions     arity  lt new gt   lt integer gt     where  lt integer gt  is the arity suffices  For variable arity relations  state    isa  lt new gt  VariableArityRelation        and for variable arity functions  include   isa  lt new gt  VariableArityFunction        Isitanattribute  Attributes areimplemented as collections  i e   concepts   so you should include the  statement    isa  lt new gt  Collection    in your file  You should also incorporate your new concept into the existing ontology  to help keep things  conceptually clear   You may find out in the process of doing so that a reason
31. wse it in more detail  as shown in Figure 7  At the top is a score  in this case   13 4656  that reports the overall structural evaluation score of the selected mapping  Note that this  score is not normalized  You will also notice a list of entity correspondences from the base and target   Each correspondence has support  which are expressions that provide evidence for the correspondence   as well as a match hypothesis score  computed from the support  which reflects SME   s confidence of the  correspondence     Candidate inferences are facts that may be true about the target  based on the mapping between base  and target  Clicking the candidate inferences link will list the candidate inferences for this mapping     Among the base 10 ta 10 candidate inferences are facts such  as  adroit John  and  commercial pleasure   These Mapping 65  facts are not present in ta 10  Moreover  the fact   commercial pleasure  doesn   t seem appropriate  Sue GRA  however  the match hypothesis between profit in base 10 Base   KBCaseFn base 10   and pleasure in ta 10 and the source of the inference Target   KBCaseFn ta 10      commercial profit  in base 10 explain the inference        Support   Base Item Target Item                                                            a      14  Ivan Christine  You can browse each candidate inference by dicking the         13  Boris John  button    this will list the source and structural support for    5  baninens M zarci  the inference     4  asset1    
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
Guida all`uso “Handycam” DCR    sliderX - Pollin  Samsung WF8702LSW User Manual  Peavey HiSys 6XT User's Manual  Eye On Electronics - MOTOR Information Systems  Sony Cyber-shot DSCT100R User's Manual  Oxygen Series - M  User Manual  TopControl Positioner Type 8630    Copyright © All rights reserved. 
   Failed to retrieve file