Skip to main content

Invertible Bidirectional Metalogical Translation Between Prolog and RuleML for Knowledge Representation and Querying

  • Conference paper
  • First Online:
Rules and Reasoning (RuleML+RR 2020)

Abstract

The paper presents BiMetaTrans(Prolog, RuleML), an invertible bidirectional metalogical translator across subsets of ISO Prolog and RuleML/XML 1.02 on the level of Negation-as-failure Horn logic with Equality. BiMetaTrans, itself written in Prolog, introduces a tighter integration between RuleML and Prolog, which enables the reuse of, e.g., RuleML Knowledge Bases (KBs) and query engines. A Prolog/ā€™$Vā€™ encoding is defined as the BiMetaTrans translation source-and-target counterpart to RuleML/XML. This metalogical encoding, along with the introduction of the split translation pattern, allows BiMetaTrans to build upon the abstraction of Definite Clause Grammars (DCGs), supporting invertible bi-translation. The BiMetaTrans DCG is explored and an invertibility proof is outlined. BiMetaTrans is exemplified for knowledge representation and querying applied to an Air Traffic Control KB.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://github.com/mthom/scryer-prolog/blob/master/src/examples/bimetatrans/.

  2. 2.

    See penultimate row of http://deliberation.ruleml.org/1.02/relaxng/#anchor table. Also note row for NafNegHornlogEq on the sublanguage path to NafFologEq. Our initial version of BiMetaTrans ā€“ like Prolog ā€“ assumes ordered conjunctions, disjunctions, and rulebases, although the corresponding RuleML/XML formula edges with index="1", index="2", ... attributes (http://wiki.ruleml.org/index.php/Glossary_of_Deliberation_RuleML_1.02#.40index) are omitted for simplicity.

  3. 3.

    http://wiki.ruleml.org/index.php/Specification_of_Deliberation_RuleML_1.02#XSLT-Based_Compactifiers.

  4. 4.

    https://wiki.ruleml.org/index.php/Glossary_of_Deliberation_RuleML_1.02#.40mapClosure.

  5. 5.

    https://www.metalevel.at/prolog/dcg#implementation.

  6. 6.

    Complementing RuleMLā€™s xsi:type, we introduce iso:type for ISO Prolog types.

  7. 7.

    The <RuleML> root is assumed by BiMetaTrans(Prolog/ā€™$Vā€™, RuleML/XML), thus simplifying its various (KB-only, query-only, KB&query) translation uses.

  8. 8.

    A conclusion compound with function symbol ā€™=ā€™ is not permissible in an ISO Prolog KB, but we are concerned only with Prolog/ā€™$Vā€™ encodings as ground terms.

  9. 9.

    http://users.ntua.gr/mitsikas/ATC_KB/ATC_KB_ISO_PL.pl.

  10. 10.

    In the Emacs text editor, the reification can be done by the interactive command M-x query-replace-regexp with basically as the matching expression and as the transform. Such a command could also be named as an Emacs Lisp function.

  11. 11.

    https://github.com/mthom/scryer-prolog.

  12. 12.

    https://github.com/mthom/scryer-prolog#strings-and-partial-strings.

References

  1. Iamnitchi, A., Trunfio, P., Ledlie, J., Schintke, F.: Peer-to-peer computing. In: Dā€™Ambra, P., Guarracino, M., Talia, D. (eds.) Euro-Par 2010. LNCS, vol. 6271, pp. 444ā€“445. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-15277-1_42

  2. Kravari, K., Bassiliades, N., Boley, H.: Cross-community interoperation between knowledge-based multi-agent systems: a study on EMERALD and Rule Responder. Expert Syst. Appl 39(10), 9571ā€“9587 (2012)

    ArticleĀ  Google ScholarĀ 

  3. Sterling, L., Shapiro, E.Y.: The Art of Prolog: Advanced Programming Techniques. MIT Press, Cambridge (1994)

    MATHĀ  Google ScholarĀ 

  4. Mitsikas, T., Stefaneas, P., Ouranos, I.: A rule-based approach for air traffic control in the vicinity of the airport. In: Lambropoulou, S., Theodorou, D., Stefaneas, P., Kauffman, L.H. (eds.) AlModTopCom 2015. SPMS, vol. 219, pp. 423ā€“438. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-68103-0_20

    ChapterĀ  MATHĀ  Google ScholarĀ 

  5. Mitsikas, T., Almpani, S., Stefaneas, P., Frangos, P., Ouranos, I.: Formalizing air traffic control regulations in PSOA RuleML. In: Proceedings of the Doctoral Consortium and Challenge@ RuleML+ RR 2018 hosted by 2nd International Joint Conference on Rules and Reasoning, vol. 2204, CEUR Workshop Proceedings (2018)

    Google ScholarĀ 

  6. Deryck, M., et al.: Aligning, interoperating, and co-executing air traffic control rules across PSOA RuleML and IDP. In: Fodor, P., Montali, M., Calvanese, D., Roman, D. (eds.) RuleML+RR 2019. LNCS, vol. 11784, pp. 52ā€“66. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-31095-0_4

    ChapterĀ  Google ScholarĀ 

  7. Boley, H., Zou, G.: Perspectival knowledge in PSOA RuleML: representation, model theory, and translation. CoRR abs/1712.02869, v3 (2019)

    Google ScholarĀ 

  8. Boley, H.: The RuleML knowledge-interoperation hub. In: Alferes, J.J.J., Bertossi, L., Governatori, G., Fodor, P., Roman, D. (eds.) RuleML 2016. LNCS, vol. 9718, pp. 19ā€“33. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-42019-6_2

    ChapterĀ  Google ScholarĀ 

  9. ISO: ISO/IEC 13211ā€“1:1995: Information technology ā€“ programming languages ā€“ prolog ā€“ part 1: general core (1995)

    Google ScholarĀ 

  10. Basin, D.A., Constable, R.L.: Metalogical frameworks. In: Proceedings of the Second Annual Workshop on Logical Frameworks, Edinburgh, UK, June 1991

    Google ScholarĀ 

  11. Pereira, F., Warren, D.H.D.: Definite clause grammars for language analysis - a survey of the formalism and a comparison with augmented transition networks. Artif. Intell. 13, 231ā€“278 (1980)

    ArticleĀ  MathSciNetĀ  Google ScholarĀ 

  12. Boley, H.: RIF RuleML Rosetta Ring: round-tripping the Dlex subset of Datalog RuleML and RIF-Core. In: Governatori, G., Hall, J., Paschke, A. (eds.) RuleML 2009. LNCS, vol. 5858, pp. 29ā€“42. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-04985-9_6

    ChapterĀ  Google ScholarĀ 

  13. Rendel, T., Ostermann, K.: Invertible syntax descriptions: unifying parsing and pretty printing. SIGPLAN Not. 45(11), 1ā€“12 (2010)

    ArticleĀ  Google ScholarĀ 

  14. DuregĆ„rd, J., Jansson, P.: Embedded parser generators. ACM SIGPLAN Not. 46(12), 107ā€“117 (2011)

    ArticleĀ  Google ScholarĀ 

  15. Matsuda, K., Wang, M.: FliPpr: a prettier invertible printing system. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 101ā€“120. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37036-6_6

    ChapterĀ  Google ScholarĀ 

  16. Al Manir, M.S., Riazanov, A., Boley, H., Baker, C.J.O.: PSOA RuleML API: a tool for processing abstract and concrete syntaxes. In: Bikakis, A., Giurca, A. (eds.) RuleML 2012. LNCS, vol. 7438, pp. 280ā€“288. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32689-9_23

    ChapterĀ  Google ScholarĀ 

Download references

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Mark Thom , Harold Boley or Theodoros Mitsikas .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

Ā© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Thom, M., Boley, H., Mitsikas, T. (2020). Invertible Bidirectional Metalogical Translation Between Prolog and RuleML for Knowledge Representation and Querying. In: GutiƩrrez-Basulto, V., Kliegr, T., Soylu, A., Giese, M., Roman, D. (eds) Rules and Reasoning. RuleML+RR 2020. Lecture Notes in Computer Science(), vol 12173. Springer, Cham. https://doi.org/10.1007/978-3-030-57977-7_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-57977-7_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-57976-0

  • Online ISBN: 978-3-030-57977-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics