Repository navigation
FAQ
Welcome to the RuleML2TPTP FAQ! This page also serves as the supporting and flexible documentation characterized by brisk questions and answers. We think that this form is better for this project than a lengthy formal document. See the project main page for other reference links.
One is to normalize the source RuleML file, and the other is for the real translation. RuleML allows abbreviated encoding (skipped edge tags and default attribute values) and some freedom in the ordering of elements. It would be much easier to do translation on normalized RuleML than the original (un-normalized) source. Moreover, RuleML has provided normalizers in XSLT that we can utilize. The normalizer we use in this project is actually the one for a super set of Datalog+, however it goes well along with this project.
<Data> represents a "any-type" data model as an alternative to literal character strings. However in the TPTP language, there is no support for any-type data. Thus we just ignore <Data> but give warnings about its occurrence in the source file.
The supported input source should be valid against this Datalog+ Deliberation RuleML 1.01 schema. <Retract> is ignored and <Data> is unsupported.
Because it is enough. The only Java class (the main class) is to parse the command line arguments and translate the input as to the parsed options by invoking JAXP calls.
Why do you bother with Java code? Why not just call Saxon directly since it is executable, or use shell scripts to shorten the commands?
Our translation has a normalization step as pre-processing. Calling Saxon directly is full of typing and memorizing. We tried shell scripts but it is platform- (or shell-) dependent. Then we found we preferred more to a platform-independent solution, so that we can avoid maintaining multiple sets of scripts for different platforms.
No. The Java code is quite straightforward. The comments in it should be enough for reading it.
Try "java -jar ruleml2tptp.tar -h" at first.
With this option, CRLF will be used to mark new lines in the output translation (like on Windows OS) instead of the default LF only.
Use option -nt, which suppresses the real translation, so only the result of normalization is written to the output. If the result of normalization is saved, for example, in a file, it can later be used as the source of the translation with option -nn, so that the normalization will not be bypassed.
Use option -c. If a pattern in regular expression follows it, only comments which content matches the pattern will be carried, and converted into proper commenting syntax, into the output.
Write that comment into two parts. Use -c to distinguish them.
The regular expression will be used directly with XPath functions. See XPath functions specification for the syntax.
See XPath functions specification for the flags. Basically "i" means case-insensitive mode, "s" means that dot can match the newline character, and "m" means multi-line mode where "^" and "$" match the start and end of a line instead of the entire input string. "v" is specific to this program, meaning not to select the comments that match the pattern, but to select those that do not match. It is like "grep -v" on UNIX/Linux.
It is because the variables, constants and functors in the source file do not conform to the TPTP language syntax, so they will be invalid in the output. RuleML2TPTP can convert alphabetic case of the first letter, or single quote constants and functors in RuleML to make them valid in the TPTP language. However, they can still be invalid after the conversion by, for example, including characters other than letters, numbers and "_" (underscores). That is when the warnings are issued.
The warnings are directed to the standard error. When, for example, the output and the standard error are both to print on the screen, warnings will be suppressed to avoid messing up the output. Redirecting and separating them will bring up the warnings.
Generally speaking, "%" followed by a space will be inserted at the beginning of each line after the line has been trimmed clear of leading and trailing whitespaces. A trimmed comment line starting with "%" will not have a "%" and a space inserted again. Here is an example comment:
<!-- An example comment:
% Indent
% A percent sign starts a comment line.
% %100 keep this
-->
It will be converted into the following:
% An example comment:
% Indent
% A percent sign starts a comment line.
% %100 keep this
Because it usually is not a good idea to break a TPTP formula with comments. Only comments outside a TPTP formula, that is, at most as deep as the child nodes of <Assert> and <Query>, can be retained.
Yes. The java library file saxon.jar can be removed, and then the local implementation will be used. Alternatively, option -t can be used to specify a third party transformer factory class. Remember to put that factory class under the class path. Whichever implementation is about to use, make sure that the implementation supports XSLT 2.0 because this project uses a normalizer and a translator both in XSLT 2.0
See through the help printed by option -h.