Abstract
Modern multi-paradigm programming languages combine the most important features of functional programming, logic programming, concurrent programming, and constraint programming. Multi-paradigm programming applied to the Maude specification language would replace the functional viewpoint by an equational viewpoint while retaining and extending the other features. A former paper illustrated how many features available in modern functional logic languages are easily definable and simulated in Maude, and showed how Maude goes beyond standard practices in the functional logic area by using, e.g. equational properties such as associativity and commutativity or order-sorted information. As a practical application the paper used the Missionaries and Cannibals equational logic program given by Goguen and Meseguer for Eqlog in the eighties. However, no relevant execution results were included due to the preliminary implementation of narrowing in Maude. In this paper we provide more relevant execution results by changing the focus from narrowing with rules (i.e., symbolic reachability) into narrowing with variant equations (i.e., equational unification), the latter now implemented in Maude 2.7.1 with very good performance.
This work was partially supported by the EU (FEDER) and the Spanish MINECO under grant TIN 2015-69175-C4-1-R, by the Spanish Generalitat Valenciana under grant PROMETEOII/2015/013, and by the US Air Force Office of Scientific Research under award number FA9550-17-1-0286.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
The original program in [21] had an error because the number of cannibals has to be lower than or equal to the number of missionaries in both sides unless there is no missionary. We discovered this error thanks to the new automated reasoning capabilities in Maude.
- 2.
Note that we do not impose here the standard condition \( Var (r) \subseteq Var (l)\), necessary for executability of rewriting in practice. Rewriting with extra variables in right-hand sides is handled at a theoretical level by allowing the matching substitution to instantiate these extra variables in any possible way. Extra variables do no pose any problem to narrowing and are part of the nondeterministic search of solutions typical of logic programming.
- 3.
- 4.
The paramodulation inference rule used in paramodulation-based theorem proving [39] is similar to narrowing and does not require non-variable positions.
- 5.
In the present implementation of Maude, we are not interested in a minimal set of unifiers, but only in a finite and complete set. Minimality is easily achieved in syntactic unification (see [30]) but it is very costly in Ax-unification or \(E \cup Ax\)-unification, e.g., the ACU-unification available in Maude does not always provide a minimal set of unifiers.
- 6.
New variables in Maude are introduced as #1:Nat or %1:Nat instead of X’.
References
Alpuente, M., Ballis, D., Falaschi, M.: Transformation and debugging of functional logic programs. In: Dovier, A., Pontelli, E. (eds.) A 25-Year Perspective on Logic Programming. LNCS, vol. 6125, pp. 271–299. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14309-0_13
Antoy, S.: Evaluation strategies for functional logic programming. J. Symb. Comput. 40, 875–903 (2005)
Antoy, S., Echahed, R., Hanus, M.: A needed narrowing strategy. J. ACM 47(4), 776–822 (2000)
Antoy, S., Hanus, M.: Functional logic programming. Commun. ACM 53(4), 74–85 (2010)
Arts, T., Zantema, H.: Termination of logic programs using semantic unification. In: Proietti, M. (ed.) LOPSTR 1995. LNCS, vol. 1048, pp. 219–233. Springer, Heidelberg (1996). https://doi.org/10.1007/3-540-60939-3_17
Bae, K., Escobar, S., Meseguer, J.: Abstract logical model checking of infinite-state systems using narrowing. In: van Raamsdonk, F. (ed.) 24th International Conference on Rewriting Techniques and Applications, RTA 2013. LIPIcs, Eindhoven, The Netherlands, 24–26 June 2013, vol. 21, pp. 81–96. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2013)
Clavel, M., et al.: Maude Manual (Version 2.7.1) (2016). http://maude.cs.illinois.edu
Clavel, M., et al.: Unification and narrowing in Maude 2.4. In: Treinen [44], pp. 380–390
Clavel, M., et al.: All About Maude - A High-Performance Logical Framework. LNCS, vol. 4350. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71999-1
Comon-Lundh, H., Delaune, S.: The finite variant property: how to get rid of some algebraic properties. In: Giesl, J. (ed.) RTA 2005. LNCS, vol. 3467, pp. 294–307. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-32033-3_22
Dershowitz, N.: Goal solving as operational semantics. In: International Logic Programming Symposium, Portland, OR, pp. 3–17. MIT Press, December 1995
Durán, F., Eker, S., Escobar, S., Martí-Oliet, N., Meseguer, J., Talcott, C.: Associative unification and symbolic reasoning modulo associativity in Maude. In: Rusu, V. (ed.) WRLA 2018. LNCS, vol. 11152, pp. 98–114. Springer, Heidelberg (2018)
Durán, F., Eker, S., Escobar, S., Martí-Oliet, N., Meseguer, J., Talcott, C.: Built-in variant generation and unification, and their applications in Maude 2.7. In: Olivetti, N., Tiwari, A. (eds.) IJCAR 2016. LNCS (LNAI), vol. 9706, pp. 183–192. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-40229-1_13
Durán, F., Eker, S., Escobar, S., Meseguer, J., Talcott, C.L.: Variants, unification, narrowing, and symbolic reachability in Maude 2.6. In: Schmidt-Schauß [41], pp. 31–40
Durán, F., Meseguer, J.: On the Church-Rosser and coherence properties of conditional order-sorted rewrite theories. J. Log. Algebr. Program. 81(7–8), 816–850 (2012)
Escobar, S.: Functional logic programming in Maude. In: Iida, S., Meseguer, J., Ogata, K. (eds.) Specification, Algebra, and Software. LNCS, vol. 8373, pp. 315–336. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-642-54624-2_16
Escobar, S., Meseguer, J.: Symbolic model checking of infinite-state systems using narrowing. In: Baader, F. (ed.) RTA 2007. LNCS, vol. 4533, pp. 153–168. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-73449-9_13
Escobar, S., Sasse, R., Meseguer, J.: Folding variant narrowing and optimal variant termination. J. Log. Algebr. Program. 81(7–8), 898–928 (2012)
Fay, M.: First-order unification in an equational theory. In: Joyner, W.H. (ed.) Proceedings of the 4th Workshop on Automated Deduction, Austin, Texas, USA, pp. 161–167. Academic Press (1979)
Goguen, J., Meseguer, J.: Eqlog: equality, types and generic modules for logic programming. In: DeGroot, D., Lindstrom, G. (eds.) Logic Programming, Functions, Relations and Equations, pp. 295–363. Prentice-Hall, Englewood Cliffs (1986)
Goguen, J.A., Meseguer, J.: Equality, types, modules, and (why not?) generics for logic programming. J. Log. Program. 1(2), 179–210 (1984)
Goguen, J.A., Meseguer, J.: Models and equality for logical programming. In: Ehrig, H., Kowalski, R., Levi, G., Montanari, U. (eds.) TAPSOFT 1987. LNCS, vol. 250, pp. 1–22. Springer, Heidelberg (1987). https://doi.org/10.1007/BFb0014969
Hanus, M.: The integration of functions into logic programming: from theory to practice. J. Log. Program. 19&20, 583–628 (1994)
Hanus, M.: Multi-paradigm declarative languages. In: Dahl, V., Niemelä, I. (eds.) ICLP 2007. LNCS, vol. 4670, pp. 45–75. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-74610-2_5
Hanus, M.: Functional logic programming: from theory to Curry. In: Voronkov, A., Weidenbach, C. (eds.) Programming Logics. LNCS, vol. 7797, pp. 123–168. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37651-1_6
Hanus, M.: Multi-paradigm languages. In: Gonzalez, T.F., Diaz-Herrera, J., Tucker, A. (eds.) Computing Handbook, Third Edition: Computer Science and Software Engineering, pp. 66:1–66:17. CRC Press (2014)
Hölldobler, S. (ed.): Foundations of Equational Logic Programming. LNCS, vol. 353. Springer, Heidelberg (1989). https://doi.org/10.1007/BFb0015791
Hullot, J.-M.: Canonical forms and unification. In: Bibel, W., Kowalski, R. (eds.) CADE 1980. LNCS, vol. 87, pp. 318–334. Springer, Heidelberg (1980). https://doi.org/10.1007/3-540-10009-1_25
Jouannaud, J.-P., Kirchner, H.: Completion of a set of rules modulo a set of equations. SIAM J. Comput. 15(4), 1155–1194 (1986)
Martelli, A., Montanari, U.: An efficient unification algorithm. ACM Trans. Program. Lang. Syst. 4(2), 258–282 (1982)
Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theor. Comput. Sci. 96(1), 73–155 (1992)
Meseguer, J.: Multiparadigm logic programming. In: Kirchner, H., Levi, G. (eds.) ALP 1992. LNCS, vol. 632, pp. 158–200. Springer, Heidelberg (1992). https://doi.org/10.1007/BFb0013826
Meseguer, J.: Membership algebra as a logical framework for equational specification. In: Presicce, F.P. (ed.) WADT 1997. LNCS, vol. 1376, pp. 18–61. Springer, Heidelberg (1998). https://doi.org/10.1007/3-540-64299-4_26
Meseguer, J.: From OBJ to Maude and beyond. In: Futatsugi, K., Jouannaud, J.-P., Meseguer, J. (eds.) Algebra, Meaning, and Computation. LNCS, vol. 4060, pp. 252–280. Springer, Heidelberg (2006). https://doi.org/10.1007/11780274_14
Meseguer, J.: Strict coherence of conditional rewriting modulo axioms. Theor. Comput. Sci. 672, 1–35 (2017)
Meseguer, J.: Symbolic reasoning methods in rewriting logic and Maude. In: Moss, L.S., de Queiroz, R., Martinez, M. (eds.) WoLLIC 2018. LNCS, vol. 10944, pp. 25–60. Springer, Heidelberg (2018). https://doi.org/10.1007/978-3-662-57669-4_2
Meseguer, J.: Variant-based satisfiability in initial algebras. Sci. Comput. Program. 154, 3–41 (2018)
Meseguer, J., Thati, P.: Symbolic reachability analysis using narrowing and its application to verification of cryptographic protocols. High.-Order Symb. Comput. 20(1–2), 123–160 (2007)
Nieuwenhuis, R., Rubio, A.: Paramodulation-based theorem proving. In: Robinson, J.A., Voronkov, A. (eds.) Handbook of Automated Reasoning, pp. 371–443. Elsevier and MIT Press (2001)
Reddy, U.S.: Narrowing as the operational semantics of functional languages. In: Proceedings of the 1985 Second Symposium on Logic Programming, Boston, Massachusetts, 15–18 July 1985, pp. 138–151. IEEE Computer Society Press (1985)
Schmidt-Schauß, M. (ed.): Proceedings of the 22nd International Conference on Rewriting Techniques and Applications, RTA 2011. LIPIcs, Novi Sad, Serbia, 30 May–1 June 2011, vol. 10. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2011)
Slagle, J.R.: Automated theorem-proving for theories with simplifiers commutativity, and associativity. J. ACM 21(4), 622–642 (1974)
TeReSe (ed.): Term Rewriting Systems. Cambridge University Press, Cambridge (2003)
Treinen, R. (ed.): RTA 2009. LNCS, vol. 5595. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02348-4
Tushkanova, E., Giorgetti, A., Ringeissen, C., Kouchnarenko, O.: A rule-based system for automatic decidability and combinability. Sci. Comput. Program. 99, 3–23 (2015)
Vigneron, L.: Automated deduction techniques for studying rough algebras. Fundamenta Informaticae 33(1), 85–103 (1998)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Switzerland AG
About this paper
Cite this paper
Escobar, S. (2018). Multi-paradigm Programming in Maude. In: Rusu, V. (eds) Rewriting Logic and Its Applications. WRLA 2018. Lecture Notes in Computer Science(), vol 11152. Springer, Cham. https://doi.org/10.1007/978-3-319-99840-4_2
Download citation
DOI: https://doi.org/10.1007/978-3-319-99840-4_2
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-99839-8
Online ISBN: 978-3-319-99840-4
eBook Packages: Computer ScienceComputer Science (R0)