CWM- PML1 Translation

Table of Contents

  1. Required Resources
  2. Trasnlation from CWM Proof Dump to PML
    1. CWM Reason Ontology
    2. PML Ontology
    3. Translation Rules
  3. Translation Examples
    1. Socreates
    2. Witch
    3. Vegterian
  4. Change Log

1. Required Resources

cwm     the reasoner that generate the proof and enables this translation
IWBrowser    you may browse the translated PML in various way (e.g. DAG, english)
Tabulator    you may browse the translated PML in a table way
cwm-pml.n3    n3 rule that translates cwm proof into PML

Note: we are translating proofs to PML1 and the PML2 (will be release during spring 2007) translator will be available soon.

2. Trasnlation from CWM Proof Dump to PML 

(TODO) review change change of translation rule

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.

reason ontology structure

Figure 2.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

A commonly encountered  CWM proof dump 

2.2. 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.

pml ontology structure

Figure 2.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.

An Example PML proof  template

2.3 Translation 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. Translation Examples

http://iw.stanford.edu/2007/tami/cwm-pml1/   the examples and copies of source document used by example

3.1 Socreates

Description
http://www.w3.org/2006/09dc-aus/swpf#(15)

how to produce
wget http://www.w3.org/2000/10/swap/test/reason/socrates.n3
cwm socrates.n3 --think --why >socrates-pf.n3
cwm socrates-pf.n3 http://www.w3.org/2000/10/swap/reason.n3 cwm-pml.n3 --think --data --rdf > socrates-pf.owl

Entry URI for Tabulator:  
http://iw.stanford.edu/2007/tami/cwm-pml1/socrates-pf.owl
Entry URI for IWBrowser:  
http://iw.stanford.edu/2007/tami/cwm-pml1/socrates-pf.owl#ns__g152,  view in IWBrowser

3.2 Witch

Description
http://dig.csail.mit.edu/breadcrumbs/node/179

how to produce  (note the reasoning has pruned  the n3 proof  by fiter)
wget http://www.w3.org/2000/10/swap/test/reason/witch.n3
wget http://www.w3.org/2000/10/swap/test/reason/witch-goal.n3
cwm witch.n3 --think --filter=witch-goal.n3 --why >witch-pf.n3
cwm witch-pf.n3 http://www.w3.org/2000/10/swap/reason.n3 cwm-pml.n3 --think --data --rdf > witch-pf.owl

Entry URI for Tabulator:  
http://iw.stanford.edu/2007/tami/cwm-pml1/witch-pf.owl
Entry URI for IWBrowser:  
http://iw.stanford.edu/2007/tami/cwm-pml1/witch-pf.owl#ns__g196,   view in IWBrowser

3.3 Vegetarian

Description
http://www.w3.org/2006/09dc-aus/swpf#(19)

how to produce
 wget http://www.w3.org/2000/10/swap/test/reason/conf_reg_ex.n3
wget http://www.w3.org/2000/10/swap/test/reason/joe_profile.n3
cwm conf_reg_ex.n3 --think --why > veg-pf.n3
cwm veg-pf.n3 http://www.w3.org/2000/10/swap/reason.n3 cwm-pml.n3 --think --data --rdf > veg-pf.owl

Entry URI for Tabulator:  
http://iw.stanford.edu/2007/tami/cwm-pml1/veg-pf.owl
Entry URI for IWBrowser:  
http://iw.stanford.edu/2007/tami/cwm-pml1/veg-pf.owl#ns__g166,   view in IWBrowser

[TODO] more examples

4. Change Log