Translating CWM Proof into PML

Working Draft

This version: 06/23/2006
Latest version: 
Editors:
Li Ding (ebiquity group, University of Maryland Baltimore County) 
Lalana Kagal,  CSAIL, MIT
Deborah L. McGuinness (Knowledge Systems Laboratory, Stanford University )
Paulo Pinheiro da Silva  (Knowledge Systems Laboratory, Stanford University)

Copyright ©2006 KSL and W3C


Abstract

Proof Markup Language (PML) helps users encode and share their proofs in RDF, and it is supported by a series of tools for generating, registering, searching, and visualizing the Proof content.  In order to expose CWM inference result in PML, we show how to translate a CWM inference dump (written in Reason ontology) to a PML document.


Table of contents

1. Introduction
2. Backgrounds
2.1 CWM reason ontology
2.2 CWM Proof Generation
2.3 PML Ontology
3. Translation
3.1 Rules
3.2 Example1
Appendix A. Action Items
Appendix B. Change log

1. Introduction

...


2. Backgrounds

2.1 CWM reason ontology

The CWM's reason ontology ( http://www.w3.org/2000/10/swap/reason.n3 ) is used for representing the proofs generated by CWM. Figure 3.1 depicts the structure of  the reason ontology: the white-rectangles denote classes defined in reason ontology; the green-rectangles denote classes defined in other ontologies; the labels on arcs denotes the properties defined in reason ontology; and the arcs denote rdfs:domain and rdfs:range of the corresponding properties.

Figure 3.1: Structure of Reason ontology.

reason:Step
  • A general step in a proof
reason:gives 
  • the conclusion of a step
  • rdfs:domain  reason:Step
  • rdfs:range reify:Formula
reason:Proof
  • A Proof step is the last step in the proof, a step which :gives that which was to be proved. Typically a document will assert just one :Proof, which a checker can then check and turn into the Formula proved - Q.E.D. .
  • rdfs:subClassOf   reason:Step
reason:Inference
  • A  inference step that applies General Modus Ponens inference rule
  • rdfs:subClassOf   reason:Step
reason:rule
  • The inference step was performed using a rule (implication) given.
  • rdfs:domain  reason:Inference
  • rdfs:range reason:Step
reason:evidence
  • The :evidence for a GMP inference step is a list of formulas, each proved by other means, which combined entail the result of making the given substitution in the antecedent of the rule.
  • the range is in fact a typed-list of reason:Step
  • rdfs:domain  reason:Inference
  • rdfs:range rdf:List

 

reason:Conjunction
  • The step of conjunction introduction: taking a bunch of component statements and building a formula from them. 
  • rdfs:subClassOf   reason:Step
reason:component
  • linking to a step whose data was used in building a conjunction
  • rdfs:domain  reason:Conjunction
  • rdfs:range reason:Step
reason:Extraction
  • The step of taking one statement out of a formula. The step is identified by the :gives formula (the statement) and the :because step's :gives formula (the formula extracted from).
  • rdfs:subClassOf   reason:Step
reason:because
  • gives the step whose data was input to this step.
  • rdfs:domain  reason:Extraction
  • rdfs:range reason:Step

 

reason:Parsing
  • The formula given was derived from parsing a resource.
  • rdfs:subClassOf   reason:Step
reason:source
  • The source document which was parsed.
  • rdfs:domain  reason:Parsing
  • rdfs:range pim-soc:Work

 

reason:CommandLine
reason:args
  • A human-readable representation of the arguments given on the command line
  • rdfs:domain  reason:CommandLine
reason:Binding
  • variable binding
reason:variable
  • The given string is that used as the identifier of the variable which is bound by this binding. The variable name has to be given as a string, rather than the variable being put here, or the variable would be treated as a variable.
  • rdfs:domain  reason:Binding
  • rdfs:range reify:String
reason:boundTo
  • This binding binds its variable to this term
  • rdfs:domain  reason:Binding
  • rdfs:range reify:Term

2.2 CWM Proof Generation

Now we use a simple example to show how CWM generate a proof encoded by reason ontology:

  1. INPUT:  a N3 file containing some n3-facts and n3-rules: http://people.csail.mit.edu/lkagal/tami/example1.n3
  2. INFERENCE: run the following command
    cwm http://people.csail.mit.edu/lkagal/tami/example1.n3 --think --filter="http://people.csail.mit.edu/lkagal/tami/example1.n3"
  3. OUTPUT:  

2.3. PML Ontology

PML ontology helps encode justification trace (one justification trace may help users reconstruct several alternative proofs for an conclusion, which can be the answer of a iw:Query). Figure 3.2 depicts the semantic structure of PML ontology  and show how to organize a collection of iw:NodeSet to represent a justification trace.

Figure 3.2 Semantic Structure of PML ontology

A NodeSet represents a step in a proof whose conclusion is justified by any of the set of inference steps associated with the NodeSet. PML adopts the term ``node set'' since each instance of NodeSet can be viewed as a set of nodes gathered from one or more proof trees having the same conclusion.

An InferenceStep represents a justification for the conclusion of a node set. Inference steps are anonymous OWL classes defined within node sets. For this reason, it is assumed that applications handling PML proofs are able to identify the node set of a inference step. Also for this reason, inference steps have no URIs.


3. Translation

3.1 Rules

Translating  instances of class

pr:Proof

=>

do nothing
AND introduction

 

pr:Conjunction  rdf:id=<URI-C>
   pr:gives {...}
   pr:component  {list of BNODE-I}
   ...

=>

iw:NodeSet  rdf:id=<URI-C>
  iw:hasConclusion  {...}
  iw:hasLanguage  [[iwRegistry#N3]]  (implicitly mentioned)      
  iw:isConsequenceOf
    iw:InferenceStep
      iw:hasRule -- [[iwRegistry#AND-introduction]]
      iw:hasInferenceEngine -- [[iwRegistry#CWM]]
      iw:hasAntecedent  rdf:parseType="collection"
          <URI-FOR-BNODE-I-1>          
          <URI-FOR-BNODE-I-2>  
          ...       
Generalized Modus Ponens

 

pr:Inference  <BNODE-I>
  pr:gives {...}
  pr:binding  {List of Mappings}
  pr:evidence  {List of BNODE-E}
  pr:rule  {List of BNODE-R}

=>

iw:NodeSet  rdf:id=<URI>
  iw:hasConclusion  {...}
  iw:hasLanguage  [[iwRegistry#N3]]  (implicitly mentioned)      
  iw:isConsequenceOf
    iw:InferenceStep
      iw:hasVariableMapping  {instance of iw:Mapping}
      ...
      iw:hasRule -- [[iwRegistry#GMP]]
      iw:hasInferenceEngine -- [[iwRegistry#CWM]]
      iw:hasAntecedent  rdf:resource=<URI-FOR-BNODE-R>          
      iw:hasAntecedent  rdf:resource=<URI-FOR-BNODE-E-1>
      iw:hasAntecedent  rdf:resource= <URI-FOR-BNODE-E-2>
          ...          
AND Elimination

pr:Extraction
  pr:gives {...}
  pr:because <URI-P>

=>

 

iw:NodeSet  rdf:id=<URI-E>
  iw:hasConclusion  {...}
  iw:hasLanguage  [[iwRegistry#N3]]  (implicitly mentioned)      
  iw:isConsequenceOf
    iw:InferenceStep
      iw:hasRule -- [[iwRegistry#AND-Elimination]]
      iw:hasInferenceEngine -- [[iwRegistry#CWM]]
     
 iw:hasAntecedent   rdf:resource=<URI-P>
       
Direct Assertion

pr:Parsing  rdf:id=<URI-P>
            pr:source <URL>
            pr:because <URI-CMD>

  iw:NodeSet  rdf:id=<URI-P>
  iw:hasConclusion  {...}
  iw:hasLanguage  [[iwRegistry#N3]]  (implicitly mentioned)      
  iw:isConsequenceOf
    iw:InferenceStep
      iw:hasRule -- [[iwRegistry#DirectAssertion]]
      iw:hasInferenceEngine -- [[iwRegistry#CWM]]
      iw:hasSourceUsage  rdf:resource=<URI-P>

 iw:SourceUsage  rdf:id=<URI-P>
          iw:usageTime ...
          iw:hasSource  <URL>

pr:CommandLine => do nothing
pr:binding  {List of Mappings}
  {BNODE}
    pr:variable
    pr:boundTo
=> iw:hasVariableMapping
  iw:Mappings
     iw:mapFrom
     iw:mapTo
...

notes:

  1. we have some discussions on differentiating pr:rule from pr:evidence. Someone (DanC?) also suggested un-ordered list. Do we still want that feature?
  2. source:  the URL source should better be absolute URL

3.2 Example1

data sources:

3.2.1 CWM dump structure analysis

Complete version: http://people.csail.mit.edu/lkagal/tami/example1-proof.n3 

3.2.2 Brief PML Representation

Complete version:  http://iw.stanford.edu/doc/project/tami/example1-pml-0518.rdf     (View example1 in IW)


Appendix A. Action Items

After May 18 meeting

  1. Find out whether hasSourceUsage can be used to link to the source documents (Li Ding)
  2. reason.n3 does not contain info about evidence, rule, and args. Add those (Lalana)
  3. Decide on mapping (Li and Lalana)
  4. Figure out how to display more than one step in IW browser (Lalana)
  5. Fix to-pml.n3 (Lalana)

Appendix B. Change Log


last modified: 06/23/2006