CWM- PML1 Translation
Table of Contents
- Required Resources
- Trasnlation from CWM Proof Dump to PML
- CWM Reason Ontology
- PML Ontology
- Translation Rules
- Translation Examples
- Socreates
- Witch
- Vegterian
- 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.
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
|
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
- pr:Proof, pr:Conjunction <URI>
- pr:gives {...}
- pr:component
- pr:Inference
- pr:binding
- [ pr:variable …, pr:boundTo …]
- [ pr:variable …, pr:boundTo …]
- pr:evidence
- pr:Extraction
- pr:gives {...}
- pr:because <URI>
- pr:Extraction
- pr:gives {...}
- pr:because <URI>
- pr:Extraction
- pr:gives {...}
- pr:because <URI>
- pr:rule
- pr:Extraction
- pr:gives {...}
- pr:because <URI>
- pr:Parsing
- pr:because: <URI>
- pr:source: <URL>
- pr:CommandLine <URI>
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.

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.
- The URI of a node set is the unique identifier of the
node set. Every node set has exactly one well-formed URI.
- The Conclusion of a node set ( i.e., the object of
iw:hasConclusion) represents the expression concluded by the proof step.
Every node set has one conclusion, and a conclusion of a node set is of type
Language.
- The Language of a node set is the language in which the
conclusion is represented. Every node set has exactly one language, and that
language is of type Language. Languages are in general registered in
the IWRegistry.
- Each InferenceStep of a node set represents an application of
an inference rule that justifies the node set's conclusion. Every node set
has at least one inference step, and each inference step of a node set is of
type InferenceStep.
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.
- The Rule of an inference step (i.e., the object of
iw:hasRule) is the rule applied to produce the conclusion. Every
inference step has one rule, and that rule is of type InferenceRule.
Rules are in general registered in the IWRegistry by engine developers.
- The Antecedents of an inference step (i.e., the object of
iw:hasAntecedent) is a collection of node sets each of whose conclusions
is a premise of the application of the inference step's rule. The
collection can contain any number of node sets including none. PML supports
the order of premises in two folds:
- The fact that the premises are ordered may be relevant for some rules
such as ordered resolution that uses the order to match premises
with the schemas of the associated rule. To this end, users may declare
one iw:hasAntecedent that links to an instance of rdf:List, which
is an ordered list of the antecedent node sets.
- For other rules such as modus Ponens, the order of the premises is
irrelevant; therefore, Antecedents can be viewed as a bag of
premises. To this end, users may declar multiple iw:hasAntecedent
each of which links to an antecedent node set.
- Each VariableMapping of an inference step (i.e., the object of
iw:hasVariableMapping) is a mapping from a variable to a term
specifying the substitutions performed on the premises before the
application of the step's rule. An inference step can have any number of
variable mappings including none, and each variable mapping is of type
Mapping. For instance, substitutions may be required to unify terms
in premises in order to perform resolution.
- Each SourceUsage of an inference step (i.e., the object of
iw:hasSourceUsage) refers to the an entity representing where
original statements from which the conclusion was obtained. It is always
used with the "direct assertion" inference rule. An inference step can
have zero to one source usage, and each source usage has exactly one
source, whose type is Source, and a usage time (i.e., the object of
iw:usageTime) indicating when the source has been used.
- The InferenceEngine of an inference step (i.e., the object of
iw:hasInferenceEngine) is the inference engine that produced the
inference step. Each inference step has one InferenceEngine, which is
of type InferenceEngine. Inference engines are in general registered
in the IWRegistry by engine developers.
An Example PML proof template
- iw:NodeSet rdf:id="g0"
- iw:hasConclusion -- {...}
- iw:hasLanguage --[[iwRegistry#N3]]
- iw:isConsequentOf
- iw:InferenceStep
- iw:hasRule -- [[iwRegistry#CWM-Conjunction]]
- iw:hasInferenceEngine -- [[iwRegistry#CWM]]
- iw:hasAntecendent -- #g00
- iw:NodeSet rdf:id="g00"
- iw:hasConclusion --{...}
- iw:hasLanguage --[[iwRegistry#N3]]
- iw:isConsequentOf
- iw:InferenceStep
- iw:hasRule --[[iwRegistry#CWM-Inference]]
(General Modus
Ponens)
- iw:hasInferenceEngine -- [[iwRegistry#CWM]]
- iw:hasVariableMapping -- the first variable mapping
- iw:hasVariableMapping -- the second variable mapping
- iw:hasAntecendent -- parseType="Collection"
- #g4 (an n3-rule)
- #g1 (n3-fact1)
- #g2 (n3-fact2)
- #g3 (n3-fact3)
- iw:NodeSet -- (g1, g2, g3, g4 respectively)
- iw:hasConclusion -- {...}
- iw:hasLanguage -- [[iwRegistry#N3]]
- iw:isConsequenceOf
- iw:InferenceStep
- iw:hasRule [[iwRegistry#CWM-Extraction]]
- iw:hasInferenceEngine -- [[iwRegistry#CWM]]
- iw:hasSourceUsage --
- iw:SourceUsage
- iw:hasSource <src>
- iw:usageTime
- iw:Source - - <src> (we can help automatically register the
source via HTTP request)
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:
- we have some discussions on differentiating pr:rule from pr:evidence.
Someone (DanC?) also suggested un-ordered list. Do we still want that
feature?
- 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
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
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:
3.3 Vegetarian
Description
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:
[TODO] more examples
4. Change Log
- 8:39 AM 2/8/2007: this document is created.
- Examples are provided by Dan Connonly
- translation
rules is authored by Lalana Kagal and Li Ding.
- section 2 is adapted from an earlier document http://iw.stanford.edu/2006/tami/