Skip to main content

2019 | OriginalPaper | Buchkapitel

Synthesizing Set Functions

verfasst von : Sergio Antoy, Michael Hanus, Finn Teegen

Erschienen in: Functional and Constraint Logic Programming

Verlag: Springer International Publishing

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

search-config
loading …

Abstract

Set functions are a feature of functional logic programming to encapsulate all results of a non-deterministic computation in a single data structure. Given a function f of a functional logic program written in Curry, we describe a technique to synthesize the definition of the set function of f. The definition produced by our technique is based on standard Curry constructs. Our approach is interesting for three reasons. It allows reasoning about set functions, it offers an implementation of set functions which can be added to any Curry system, and it has the potential of changing our thinking about the implementation of non-determinism, a notoriously difficult problem.

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
The notion of “plural function” is also used in [22] to define a “plural” semantics for functional logic programs. Although the type of their plural functions is identical to ours, their semantics is quite different.
 
2
Actually, this operation is the monadic “bind” operation with flipped arguments if https://static-content.springer.com/image/chp%3A10.1007%2F978-3-030-16202-3_6/482311_1_En_6_IEq92_HTML.gif is an instance of https://static-content.springer.com/image/chp%3A10.1007%2F978-3-030-16202-3_6/482311_1_En_6_IEq93_HTML.gif , as proposed in [13]. Here, we prefer to provide a more direct implementation.
 
3
This is a consequence of the fact that https://static-content.springer.com/image/chp%3A10.1007%2F978-3-030-16202-3_6/482311_1_En_6_IEq96_HTML.gif is a functor. A more general treatment of these structures can be found in [6].
 
4
Although the current definition of Curry [17] does not include type classes, many implementations of Curry, like PAKCS, KiCS2, or MCC, support them.
 
5
The use of https://static-content.springer.com/image/chp%3A10.1007%2F978-3-030-16202-3_6/482311_1_En_6_IEq124_HTML.gif ensures that the https://static-content.springer.com/image/chp%3A10.1007%2F978-3-030-16202-3_6/482311_1_En_6_IEq125_HTML.gif argument is evaluated. Thus, non-determinism and failures in arguments of set functions are not encapsulated, as intended.
 
6
Multi-parameter type classes are not yet supported in the Curry systems PAKCS and KiCS2. The code presented here is more elegant, but equivalent, to the actual implementation.
 
7
Of course, one can replace such lists by more efficient access structures.
 
8
This requires a specific primitive https://static-content.springer.com/image/chp%3A10.1007%2F978-3-030-16202-3_6/482311_1_En_6_IEq204_HTML.gif to catch failures, which is usually supported in Curry implementations to handle exceptions.
 
Literatur
4.
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)
5.
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 Braßel, B., Hanus, M., Huch, F.: Encapsulating non-determinism in functional logic computations. J. Funct. Log. Program. 6, 2004 (2004)MathSciNetMATH Braßel, B., Hanus, M., Huch, F.: Encapsulating non-determinism in functional logic computations. J. Funct. Log. Program. 6, 2004 (2004)MathSciNetMATH
10.
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)
11.
Zurück zum Zitat de Dios Castro, J., López-Fraguas, F.J.: Extra variables can be eliminated from functional logic programs. Electron. Notes Theor. Comput. Sci. 188, 3–19 (2007)CrossRef de Dios Castro, J., López-Fraguas, F.J.: Extra variables can be eliminated from functional logic programs. Electron. Notes Theor. Comput. Sci. 188, 3–19 (2007)CrossRef
12.
13.
Zurück zum Zitat Fischer, S., Kiselyov, O., Shan, C.: Purely functional lazy nondeterministic programming. J. Funct. program. 21(4&5), 413–465 (2011)MathSciNetCrossRef Fischer, S., Kiselyov, O., Shan, C.: Purely functional lazy nondeterministic programming. J. Funct. program. 21(4&5), 413–465 (2011)MathSciNetCrossRef
14.
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. Log. Program. 40, 47–87 (1999)MathSciNetCrossRef 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. Log. Program. 40, 47–87 (1999)MathSciNetCrossRef
18.
Zurück zum Zitat Hinze, R.: Prolog’s control constructs in a functional setting - axioms and implementation. Int. J. Found. Comput. Sci. 12(2), 125–170 (2001)CrossRef Hinze, R.: Prolog’s control constructs in a functional setting - axioms and implementation. Int. J. Found. Comput. Sci. 12(2), 125–170 (2001)CrossRef
19.
Zurück zum Zitat Hussmann, H.: Nondeterministic algebraic specifications and nonconfluent term rewriting. J. Log. Program. 12, 237–255 (1992)MathSciNetCrossRef Hussmann, H.: Nondeterministic algebraic specifications and nonconfluent term rewriting. J. Log. Program. 12, 237–255 (1992)MathSciNetCrossRef
20.
Zurück zum Zitat López-Fraguas, F.J., Rodríguez-Hortalá, J., Sánchez-Hernández, J.: A simple rewrite notion for call-time choice semantics. In: Proceedings of the 9th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP 2007), pp. 197–208. ACM Press (2007) López-Fraguas, F.J., Rodríguez-Hortalá, J., Sánchez-Hernández, J.: A simple rewrite notion for call-time choice semantics. In: Proceedings of the 9th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP 2007), pp. 197–208. ACM Press (2007)
22.
Zurück zum Zitat Riesco, A., Rodríguez-Hortalá, J.: Singular and plural functions for functional logic programming. Theory Pract. Log. Program. 14(1), 65–116 (2014)MathSciNetCrossRef Riesco, A., Rodríguez-Hortalá, J.: Singular and plural functions for functional logic programming. Theory Pract. Log. Program. 14(1), 65–116 (2014)MathSciNetCrossRef
23.
Zurück zum Zitat Seres, S., Spivey, M., Hoare, T.: Algebra of logic programming. In: Proceedings of the ICLP 1999, pp. 184–199. MIT Press (1999) Seres, S., Spivey, M., Hoare, T.: Algebra of logic programming. In: Proceedings of the ICLP 1999, pp. 184–199. MIT Press (1999)
24.
Metadaten
Titel
Synthesizing Set Functions
verfasst von
Sergio Antoy
Michael Hanus
Finn Teegen
Copyright-Jahr
2019
DOI
https://doi.org/10.1007/978-3-030-16202-3_6