Skip to content

Commit 78eaf21

Browse files
committed
deal with data by using distinct object in TPTP
1 parent 6f15e65 commit 78eaf21

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

src/main/resources/org/ruleml/translation/ruleml2tptp/xslt/ruleml2tptp.xslt

+9-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@
366366
<xsl:apply-templates select="r:op"/>
367367
<!-- sorted args -->
368368
<xsl:call-template name="optional-list">
369-
<xsl:with-param name="list" select="r:arg/(r:Ind | r:Var | r:Expr)"/>
369+
<xsl:with-param name="list" select="r:arg/(r:Ind | r:Var | r:Expr | r:Data)"/>
370370
</xsl:call-template>
371371
</xsl:template>
372372

@@ -392,6 +392,14 @@
392392
</xsl:choose>
393393
</xsl:template>
394394

395+
<!-- Data are assumed to not themselves contain double-quotes, hence in the TPTP language currently simply become
396+
double-quoted strings -->
397+
<xsl:template match="r:Data">
398+
<xsl:text>"</xsl:text>
399+
<xsl:value-of select="."/>
400+
<xsl:text>"</xsl:text>
401+
</xsl:template>
402+
395403
<xsl:template name="normalize-text">
396404
<xsl:param name="text" required="yes" as="xs:string"/>
397405

src/test/resources/test/translator/fol/DataTest.ruleml

+19-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,28 @@
33
<RuleML xmlns="http://ruleml.org/spec">
44
<Assert>
55
<Atom>
6-
<Rel>object</Rel>
7-
<Var>_G1609</Var>
6+
<Rel>o</Rel>
87
<Ind>dog</Ind>
9-
<Ind>countable</Ind>
10-
<Ind>na</Ind>
118
<Ind>eq</Ind>
129
<Data>1</Data>
1310
</Atom>
11+
<Atom>
12+
<Rel>o</Rel>
13+
<Data>cat</Data>
14+
<Ind>eq</Ind>
15+
<Ind>dog</Ind>
16+
</Atom>
17+
<Atom>
18+
<Rel>o</Rel>
19+
<Data>CAT</Data>
20+
<Ind>eq</Ind>
21+
<Data>DOG</Data>
22+
</Atom>
23+
<Atom>
24+
<Rel>o</Rel>
25+
<Data>All</Data>
26+
<Data>DATA</Data>
27+
<Data>here</Data>
28+
</Atom>
1429
</Assert>
1530
</RuleML>
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
fof(act1_formula1,axiom,(
2-
object(_G1609,dog,countable,na,eq) )).
2+
o(dog,eq,"1") )).
3+
4+
fof(act1_formula2,axiom,(
5+
o("cat",eq,dog) )).
6+
7+
fof(act1_formula3,axiom,(
8+
o("CAT",eq,"DOG") )).
9+
10+
fof(act1_formula4,axiom,(
11+
o("All","DATA","here") )).
312

0 commit comments

Comments
 (0)