Skip to main content

2016 | OriginalPaper | Buchkapitel

Default Rules for Curry

verfasst von : Sergio Antoy, Michael Hanus

Erschienen in: Practical Aspects of Declarative Languages

Verlag: Springer International Publishing

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

In functional logic programs, rules are applicable independently of textual order, i.e., any rule can potentially be used to evaluate an expression. This is similar to logic languages and contrary to functional languages, e.g., Haskell enforces a strict sequential interpretation of rules. However, in some situations it is convenient to express alternatives by means of compact default rules. Although default rules are often used in functional programs, the non-deterministic nature of functional logic programs does not allow to directly transfer this concept from functional to functional logic languages in a meaningful way. In this paper we propose a new concept of default rules for Curry that supports a programming style similar to functional programming while preserving the core properties of functional logic programming, i.e., completeness, non-determinism, and logic-oriented uses of functions. We discuss the basic concept and sketch an initial implementation of it which exploits advanced features of functional logic languages.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Fußnoten
1
Note that Curry requires the explicit declaration of free variables, as x in the rule of dup, to ensure checkable redundancy.
 
2
We consider only conditional rules since an unconditional rule can be regarded as a conditional rule with condition True.
 
Literatur
1.
Zurück zum Zitat Antoy, S.: Definitional trees. In: Kirchner, H., Levi, G. (eds.) ALP 1992. LNCS, vol. 632, pp. 143–157. Springer, Heidelberg (1992)CrossRef Antoy, S.: Definitional trees. In: Kirchner, H., Levi, G. (eds.) ALP 1992. LNCS, vol. 632, pp. 143–157. Springer, Heidelberg (1992)CrossRef
2.
Zurück zum Zitat Antoy, S.: Optimal non-deterministic functional logic computations. In: Hanus, M., Heering, J., Meinke, K. (eds.) ALP/HOA 1997. LNCS, vol. 1298, pp. 16–30. Springer, Heidelberg (1997)CrossRef Antoy, S.: Optimal non-deterministic functional logic computations. In: Hanus, M., Heering, J., Meinke, K. (eds.) ALP/HOA 1997. LNCS, vol. 1298, pp. 16–30. Springer, Heidelberg (1997)CrossRef
4.
Zurück zum Zitat Antoy, S., Hanus, M.: Declarative programming with function patterns. In: Hill, P.M. (ed.) LOPSTR 2005. LNCS, vol. 3901, pp. 6–22. Springer, Heidelberg (2006)CrossRef Antoy, S., Hanus, M.: Declarative programming with function patterns. In: Hill, P.M. (ed.) LOPSTR 2005. LNCS, vol. 3901, pp. 6–22. Springer, Heidelberg (2006)CrossRef
5.
Zurück zum Zitat Antoy, S., Hanus, M.: Overlapping rules and logic variables in functional logic programs. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 87–101. Springer, Heidelberg (2006)CrossRef Antoy, S., Hanus, M.: Overlapping rules and logic variables in functional logic programs. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 87–101. Springer, Heidelberg (2006)CrossRef
6.
Zurück zum Zitat Antoy, S., Hanus, M.: Set functions for functional logic programming. In: Proceedings of the 11th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP 2009), pp. 73–82. ACM Press (2009) Antoy, S., Hanus, M.: Set functions for functional logic programming. In: Proceedings of the 11th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP 2009), pp. 73–82. ACM Press (2009)
7.
Zurück zum Zitat Antoy, S., Hanus, M.: Functional logic programming. Commun. ACM 53(4), 74–85 (2010)CrossRef Antoy, S., Hanus, M.: Functional logic programming. Commun. ACM 53(4), 74–85 (2010)CrossRef
8.
Zurück zum Zitat Antoy, S., Hanus, M.: Curry without success. In: Proceedings of the 23rd International Workshop on Functional and (Constraint) Logic Programming (WFLP 2014). CEUR Workshop Proceedings, vol. 1335, pp. 140–154. CEUR-WS.org (2014) Antoy, S., Hanus, M.: Curry without success. In: Proceedings of the 23rd International Workshop on Functional and (Constraint) Logic Programming (WFLP 2014). CEUR Workshop Proceedings, vol. 1335, pp. 140–154. CEUR-WS.org (2014)
9.
Zurück zum Zitat Braßel, B., Hanus, M., Huch, F.: Encapsulating non-determinism in functional logic computations. J. Funct. Logic Program. 2004(6) (2004) Braßel, B., Hanus, M., Huch, F.: Encapsulating non-determinism in functional logic computations. J. Funct. Logic Program. 2004(6) (2004)
10.
Zurück zum Zitat Braßel, B., Hanus, M., Peemöller, B., Reck, F.: KiCS2: a new compiler from Curry to Haskell. In: Kuchen, H. (ed.) WFLP 2011. LNCS, vol. 6816, pp. 1–18. Springer, Heidelberg (2011)CrossRef Braßel, B., Hanus, M., Peemöller, B., Reck, F.: KiCS2: a new compiler from Curry to Haskell. In: Kuchen, H. (ed.) WFLP 2011. LNCS, vol. 6816, pp. 1–18. Springer, Heidelberg (2011)CrossRef
11.
Zurück zum Zitat Christiansen, J., Hanus, M., Reck, F., Seidel, D.: A semantics for weakly encapsulated search in functional logic programs. In: Proceedings of the 15th International Symposium on Principle and Practice of Declarative Programming (PPDP 2013), pp. 49–60. ACM Press (2013) Christiansen, J., Hanus, M., Reck, F., Seidel, D.: A semantics for weakly encapsulated search in functional logic programs. In: Proceedings of the 15th International Symposium on Principle and Practice of Declarative Programming (PPDP 2013), pp. 49–60. ACM Press (2013)
12.
Zurück zum Zitat Deransart, P., Ed-Dbali, A., Cervoni, L.: Prolog - The Standard: Reference Manual. Springer, Heidelberg (1996)CrossRefMATH Deransart, P., Ed-Dbali, A., Cervoni, L.: Prolog - The Standard: Reference Manual. Springer, Heidelberg (1996)CrossRefMATH
13.
Zurück zum Zitat González-Moreno, J.C., Hortalá-González, M.T., López-Fraguas, F.J., Rodríguez-Artalejo, M.: An approach to declarative programming based on a rewriting logic. J. Logic Program. 40, 47–87 (1999)CrossRefMATHMathSciNet González-Moreno, J.C., Hortalá-González, M.T., López-Fraguas, F.J., Rodríguez-Artalejo, M.: An approach to declarative programming based on a rewriting logic. J. Logic Program. 40, 47–87 (1999)CrossRefMATHMathSciNet
14.
Zurück zum Zitat Hanus, M.: Declarative processing of semistructured web data. In: Technical Communications of the 27th International Conference on Logic Programming. Leibniz International Proceedings in Informatics (LIPIcs), vol. 11, pp. 198–208 (2011) Hanus, M.: Declarative processing of semistructured web data. In: Technical Communications of the 27th International Conference on Logic Programming. Leibniz International Proceedings in Informatics (LIPIcs), vol. 11, pp. 198–208 (2011)
15.
Zurück zum Zitat 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)CrossRef 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)CrossRef
18.
Zurück zum Zitat Krauss, A.: Pattern minimization problems over recursive data types. In: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming (ICFP 2008), pp. 267–274. ACM Press (2008) Krauss, A.: Pattern minimization problems over recursive data types. In: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming (ICFP 2008), pp. 267–274. ACM Press (2008)
19.
Zurück zum Zitat López-Fraguas, F.J., Sánchez-Hernández, J.: A proof theoretic approach to failure in functional logic programming. Theory Pract. Logic Program. 4(1), 41–74 (2004)CrossRefMATHMathSciNet López-Fraguas, F.J., Sánchez-Hernández, J.: A proof theoretic approach to failure in functional logic programming. Theory Pract. Logic Program. 4(1), 41–74 (2004)CrossRefMATHMathSciNet
20.
Zurück zum Zitat Moreno-Navarro, J.J.: Default rules: an extension of constructive negation for narrowing-based languages. In: Proceedings of Eleventh International Conference on Logic Programming, pp. 535–549. MIT Press (1994) Moreno-Navarro, J.J.: Default rules: an extension of constructive negation for narrowing-based languages. In: Proceedings of Eleventh International Conference on Logic Programming, pp. 535–549. MIT Press (1994)
21.
Zurück zum Zitat Peyton Jones, S. (ed.): Haskell 98 Language and Libraries—The Revised Report. Cambridge University Press, Cambridge (2003)MATH Peyton Jones, S. (ed.): Haskell 98 Language and Libraries—The Revised Report. Cambridge University Press, Cambridge (2003)MATH
22.
Zurück zum Zitat Reddy, U.S.: Narrowing as the operational semantics of functional languages. In: Proceedings of IEEE International Symposium on Logic Programming, Boston, pp. 138–151 (1985) Reddy, U.S.: Narrowing as the operational semantics of functional languages. In: Proceedings of IEEE International Symposium on Logic Programming, Boston, pp. 138–151 (1985)
23.
Zurück zum Zitat Sánchez-Hernández, J.: Constructive failure in functional-logic programming: from theory to implementation. J. Univ. Comput. Sci. 12(11), 1574–1593 (2006) Sánchez-Hernández, J.: Constructive failure in functional-logic programming: from theory to implementation. J. Univ. Comput. Sci. 12(11), 1574–1593 (2006)
24.
Zurück zum Zitat Slagle, J.R.: Automated theorem-proving for theories with simplifiers, commutativity, and associativity. J. ACM 21(4), 622–642 (1974)MathSciNetCrossRefMATH Slagle, J.R.: Automated theorem-proving for theories with simplifiers, commutativity, and associativity. J. ACM 21(4), 622–642 (1974)MathSciNetCrossRefMATH
Metadaten
Titel
Default Rules for Curry
verfasst von
Sergio Antoy
Michael Hanus
Copyright-Jahr
2016
DOI
https://doi.org/10.1007/978-3-319-28228-2_5

Premium Partner