Background System Architecture Implementation Summary and Future Work PSOA2TPTP: A Reference Translator for Interoperating PSOA RuleML with TPTP Reasoners Gen Zou 1 Reuben Peter-Paul 1 Harold Boley 1,2 Alexandre Riazanov 3 1 Faculty of Computer Science, University of New Brunswick, Fredericton, Canada 2 National Research Council Canada, Information and Communications Technologies 3 Department of Computer Science & Applied Statistics University of New Brunswick, Saint John, Canada 1 / 29
29
Embed
PSOA2TPTP: A Reference Translator for Interoperating PSOA ...boley/talks/DirectPSOA2TPTP-talk.pdf · PSOA-to-TPTP Translation RESTful Web API Parser Grammar Rewriting ANTLR-generated
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
BackgroundSystem Architecture
ImplementationSummary and Future Work
PSOA2TPTP: A Reference Translatorfor Interoperating PSOA RuleML
with TPTP Reasoners
Gen Zou1 Reuben Peter-Paul1 Harold Boley1,2
Alexandre Riazanov3
1Faculty of Computer Science,University of New Brunswick, Fredericton, Canada
2National Research Council Canada,Information and Communications Technologies
3Department of Computer Science & Applied StatisticsUniversity of New Brunswick, Saint John, Canada
1 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
Outline
1 Background
2 System Architecture
3 ImplementationANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
4 Summary and Future Work
2 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
Outline
1 Background
2 System Architecture
3 ImplementationANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
VampirePrimeOpen-source TPTP reasoner derived from thehigh-performance Vampire reasoner
6 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
Outline
1 Background
2 System Architecture
3 ImplementationANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
4 Summary and Future Work
7 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
Components and Workflow of PSOA2TPTP
ANTLR: ANother Tool for Language RecognitionASO: Abstract Syntax Object
8 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
Workflow of ANTLR-Generated Components
AST: Abstract Syntax Tree (condensedtree encoding of the input stream)
9 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
ANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
Outline
1 Background
2 System Architecture
3 ImplementationANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
4 Summary and Future Work
10 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
ANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
Outline
1 Background
2 System Architecture
3 ImplementationANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
4 Summary and Future Work
11 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
ANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
Parser Grammar Rewriting
ANTLR-generated parser uses LL (Left-to-right scanning,Leftmost derivation) mechanismThe original EBNF grammar of PSOA/PS extended withsyntactic sugar is non-LL and cannot be directly used asthe ANTLR parser grammarWe rewrite it into an LL(1) grammar, so that it not only canbe accepted by ANTLR but is also more efficient
Elimination of left recursionLeft factoring
12 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
ANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
Parser Grammar Rewriting
Elimination of left recursion – examplepsoa : term '#' term ('(' tuples_and_slots ')')?
| term '(' tuples_and_slots ')' ;term : const | var | psoa | external_term
is rewritten toterm : psoa | non_psoa_term ;non_psoa_term : const | var | external_term ;psoa : non_psoa_term psoa_rest+ ;
13 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
ANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
Parser Grammar Rewriting
Left factoring – exampletuples_and_slots: tuple* (term '->' term)*
| term+ (term '->' term)* ;
is rewritten totuples_and_slots: tuple+ (term '->' term)*
| term+ ('->' term (term '->' term)*)?|;
14 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
ANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
Outline
1 Background
2 System Architecture
3 ImplementationANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
4 Summary and Future Work
15 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
ANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
Normalization – Static Tupribution and Slotribution
Transform composite formulas into a conjunction of elementaryconstructs
ANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
Outline
1 Background
2 System Architecture
3 ImplementationANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
4 Summary and Future Work
24 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
ANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
RESTful Web API
PSOATransRun wraps PSOA2TPTP and VampirePrimeinto two REST services
Translation: PSOA2TPTPExecution: VampirePrime
Requests are sent via HTTP POST methodInputs and outputs are JSON-encoded stringsAvailable online (documentation and system):http://wiki.ruleml.org/index.php/PSOA_RuleML#PSOATransRun
3 ImplementationANTLR GrammarsPSOA-to-TPTP TranslationRESTful Web API
4 Summary and Future Work
26 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
Summary
We have implemented a first version of the PSOA2TPTPtranslator using the ANTLR v3 frameworkThus provide a semantics-preserving translation fromPSOA RuleML to TPTPPSOATransRun wraps PSOA2TPTP and VampirePrimeinto REST services for convenient access
27 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
Future Work
Extend PSOA2TPTP capability to handle all PSOA RuleMLconstructsImplement the fully-ASO-based translatorDevelop real-world Clinical Intelligence use case andothers employing PSOATransRun
28 / 29
BackgroundSystem Architecture
ImplementationSummary and Future Work
References
Boley, H.A RIF-Style Semantics for RuleML-Integrated Positional-Slotted,Object-Applicative RulesIn Bassiliades, N., Governatori, G., Paschke, A. (eds.)RuleML Europe, vol. 6826 of LNCS, pp. 194–211. Springer, 2011.
Zou, G., Peter-Paul, R., Boley, H. and Riazanov, A.PSOA2TPTP: A Reference Translator for Interoperating PSOA RuleML withTPTP ReasonersIn: Bikakis, A., Giurca, A. (eds.)RuleML 2012, vol. 7438 of LNCS, pp. 264–279. Springer, 2012.
Al Manir, M.S., Riazanov, A., Boley, H. and Baker, C.J.O.PSOA RuleML API: A Tool for Processing Abstract and Concrete SyntaxesIn: Bikakis, A., Giurca, A. (eds.)RuleML 2012, vol. 7438 of LNCS, pp. 280–288. Springer, 2012.