Skip to main content
Erschienen in:
Buchtitelbild

2016 | OriginalPaper | Buchkapitel

Programming in Picat

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

search-config
loading …

Abstract

Picat (picat-lang.org) is a logic-based multi-paradigm programming language that integrates logic programming, functional programming, constraint programming, and scripting. Picat takes many features from other languages, including logic variables, unification, backtracking, pattern-matching rules, functions, list/array comprehensions, loops, assignments, tabling for dynamic programming and planning, and constraint solving with CP (constraint programming), SAT (satisfiability), and MIP (mixed integer programming). These features make Picat more convenient than Prolog for scripting and modeling, and more suitable than functional languages (such as Haskell and F#) and scripting languages (such as Python and Ruby) for symbolic computations. This article provides a quick introduction to Picat using examples from Google Code Jam (GCJ).

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
3
The minof predicate, which takes another predicate call as the first argument, is called a higher-order predicate. Picat provides several higher-order built-ins. For example, maxof( Goal,Exp ), find_all( Template,Goal ), and count_all( Goal ).
 
4
The function permutations( L ), which is defined in the util module, returns a list of permutations of L.
 
7
Picat does not issue singleton variable warnings for variable names that begin with the underscore _.
 
Literatur
1.
Zurück zum Zitat Appa, G.M., Pitsoulis, L., Springer, H., Williams, P.: Handbook on Modelling for Discrete Optimization. International Series in Operations Research & Management Science. Springer, New York (2010) Appa, G.M., Pitsoulis, L., Springer, H., Williams, P.: Handbook on Modelling for Discrete Optimization. International Series in Operations Research & Management Science. Springer, New York (2010)
2.
Zurück zum Zitat Armstrong, J.: Programming Erlang, 2nd edn. Pragmatic Press, Dallas (2013) Armstrong, J.: Programming Erlang, 2nd edn. Pragmatic Press, Dallas (2013)
3.
Zurück zum Zitat Barták, R., Dovier, A., Zhou, N.-F.: On modeling planning problems in tabled logic programming. In: Proceedings of the 17th ACM International Symposium on Principles and Practice of Declarative Programming, PPDP 2015, pp. 31–42 (2015) Barták, R., Dovier, A., Zhou, N.-F.: On modeling planning problems in tabled logic programming. In: Proceedings of the 17th ACM International Symposium on Principles and Practice of Declarative Programming, PPDP 2015, pp. 31–42 (2015)
4.
Zurück zum Zitat Colmerauer, A.: Equations and inequations on finite and infinite trees. In: Proceedings of FGCS, pp. 85–99. ICOT (1984) Colmerauer, A.: Equations and inequations on finite and infinite trees. In: Proceedings of FGCS, pp. 85–99. ICOT (1984)
5.
Zurück zum Zitat Debray, S.K.: Static inference of modes and data dependencies in logic programs. ACM Trans. Program. Lang. Syst. 11(3), 418–450 (1989)CrossRef Debray, S.K.: Static inference of modes and data dependencies in logic programs. ACM Trans. Program. Lang. Syst. 11(3), 418–450 (1989)CrossRef
6.
Zurück zum Zitat Dymchenko, S., Mykhailova, M.: Declaratively solving Google Code Jam problems with Picat. In: Pontelli, E., Son, T.C. (eds.) PADL 2015. LNCS, vol. 9131, pp. 50–57. Springer, Heidelberg (2015)CrossRef Dymchenko, S., Mykhailova, M.: Declaratively solving Google Code Jam problems with Picat. In: Pontelli, E., Son, T.C. (eds.) PADL 2015. LNCS, vol. 9131, pp. 50–57. Springer, Heidelberg (2015)CrossRef
7.
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
10.
Zurück zum Zitat Malik, S., Zhang, L.: Boolean satisfiability: from theoretical hardness to practical success. Commun. ACM 52(8), 76–82 (2009)CrossRef Malik, S., Zhang, L.: Boolean satisfiability: from theoretical hardness to practical success. Commun. ACM 52(8), 76–82 (2009)CrossRef
11.
Zurück zum Zitat Nethercote, N., Stuckey, P.J., Becket, R., Brand, S., Duck, G.J., Tack, G.: MiniZinc: towards a standard CP modelling language. In: CP, pp. 529–543 (2007) Nethercote, N., Stuckey, P.J., Becket, R., Brand, S., Duck, G.J., Tack, G.: MiniZinc: towards a standard CP modelling language. In: CP, pp. 529–543 (2007)
12.
Zurück zum Zitat Rossi, F., van Beek, P., Walsh, T.: Handbook of Constraint Programming. Elsevier, Amsterdam (2006)MATH Rossi, F., van Beek, P., Walsh, T.: Handbook of Constraint Programming. Elsevier, Amsterdam (2006)MATH
13.
Zurück zum Zitat Van Roy, P., Haridi, S.: Concepts, Techniques, and Models of Computer Programming. MIT Press, Cambridge (2004) Van Roy, P., Haridi, S.: Concepts, Techniques, and Models of Computer Programming. MIT Press, Cambridge (2004)
14.
Zurück zum Zitat Schimpf, J.: Logical loops. In: Stuckey, P.J. (ed.) ICLP 2002. LNCS, vol. 2401, pp. 224–238. Springer, Heidelberg (2002)CrossRef Schimpf, J.: Logical loops. In: Stuckey, P.J. (ed.) ICLP 2002. LNCS, vol. 2401, pp. 224–238. Springer, Heidelberg (2002)CrossRef
15.
Zurück zum Zitat Warren, D.S.: Memoing for logic programs. Commun. ACM, Special Sect. Logic Program. 35, 93–111 (1992)MathSciNet Warren, D.S.: Memoing for logic programs. Commun. ACM, Special Sect. Logic Program. 35, 93–111 (1992)MathSciNet
16.
Zurück zum Zitat Zhou, N.-F.: The language features and architecture of B-Prolog. Theory Pract. Logic Program., Special Issue Prolog Syst. 12(1–2), 189–218 (2012)MathSciNetCrossRefMATH Zhou, N.-F.: The language features and architecture of B-Prolog. Theory Pract. Logic Program., Special Issue Prolog Syst. 12(1–2), 189–218 (2012)MathSciNetCrossRefMATH
17.
Zurück zum Zitat Zhou, N.-F., Bartak, R., Dovier, A.: Planning as tabled logic programming. Theory Pract. Logic Program. 15, 543–558 (2015)MathSciNetCrossRef Zhou, N.-F., Bartak, R., Dovier, A.: Planning as tabled logic programming. Theory Pract. Logic Program. 15, 543–558 (2015)MathSciNetCrossRef
19.
Zurück zum Zitat Zhou, N.-F., Have, C.T.: Efficient tabling of structured data with enhanced hash-consing. Theory Pract. Logic Program. 12(4–5), 547–563 (2012)CrossRefMATH Zhou, N.-F., Have, C.T.: Efficient tabling of structured data with enhanced hash-consing. Theory Pract. Logic Program. 12(4–5), 547–563 (2012)CrossRefMATH
21.
Zurück zum Zitat Zhou, N.-F., Kjellerstrand, H., Fruhman, J.: Constraint Solving and Planning with Picat. SpringerBriefs in Intelligent Systems. Springer, Heidelberg (2015)CrossRef Zhou, N.-F., Kjellerstrand, H., Fruhman, J.: Constraint Solving and Planning with Picat. SpringerBriefs in Intelligent Systems. Springer, Heidelberg (2015)CrossRef
22.
Zurück zum Zitat Zhou, N.-F., Sato, T., Shen, Y.-D.: Linear tabling strategies and optimizations. Theory Pract. Logic Program. 8(1), 81–109 (2008)MathSciNetMATH Zhou, N.-F., Sato, T., Shen, Y.-D.: Linear tabling strategies and optimizations. Theory Pract. Logic Program. 8(1), 81–109 (2008)MathSciNetMATH
Metadaten
Titel
Programming in Picat
verfasst von
Neng-Fa Zhou
Copyright-Jahr
2016
DOI
https://doi.org/10.1007/978-3-319-42019-6_1