Skip to main content

Canonicalizing High-Level Constructs in Picat

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 2017)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10137))

Included in the following conference series:

Abstract

Picat is a logic-based multi-paradigm dynamic language that integrates logic programming, functional programming, constraint programming, and scripting. The Picat language is underpinned by the core logic programming concepts, including logic variables, unification, and nondeterminism. Picat takes many constructs from other languages, among which functions, list and array comprehensions, loops, and assignments are convenient for scripting and modeling. This paper gives an overview of the language features of Picat, and shows how different language constructs are compiled into a canonical form.

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.

    A structure requires a preceding dollar symbol, as in $f(a,b,c), to distinguish the structure from a function call, unless the structure is special, or it occurs in a special context.

  2. 2.

    http://dlang.org/spec/function.html.

  3. 3.

    It is possible to write an infinite loop as while (true) Goal end.

  4. 4.

    https://code.google.com/codejam/contest/4314486/dashboard#s=p2&a=2.

  5. 5.

    The double negation not not is used here to discard the generated constraints after the case is done.

  6. 6.

    Since \(\texttt {J}\le \mathtt{P}\le \mathtt{S}\), \(\texttt {min(J}\times \mathtt{P}\times \mathtt{K,}~~\mathtt{P}\times \mathtt{S}\times \mathtt{K,}~~\mathtt{J}\times \mathtt{S}\times \mathtt{K)}\) equals \(\texttt {J}\times \mathtt{P}\times \mathtt{K}\).

  7. 7.

    http://fsharp.org/.

  8. 8.

    http://ocaml.org/.

References

  1. Colmerauer, A.: Equations and inequations on finite and infinite trees. In: Proceedings of FGCS, pp. 85–99. ICOT (1984)

    Google Scholar 

  2. Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Efficiently computing static single assignment form, the control dependence graph. ACM Trans. Program. Lang. Syst. 13(4), 451–490 (1991)

    Article  Google Scholar 

  3. Dincbas, M., Van Hentenryck, P., Simonis, H., Aggoun, A., Graf, T., Berthier, F.: The constraint logic programming language CHIP. In FGCS, pp. 693–702 (1988)

    Google Scholar 

  4. 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, Cham (2015). doi:10.1007/978-3-319-19686-2_4

    Chapter  Google Scholar 

  5. Hanus, M.: Functional logic programming: from theory to curry. In: Programming Logics, pp. 123–168 (2013)

    Google Scholar 

  6. Van Hentenryck, P.: Constraint and integer programming in OPL. INFORMS J. Comput. 14, 2002 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  7. Hermenegildo, M.V., Bueno, F., Carro, M., López-García, P., Mera, E., Morales, J.F., Puebla, G.: An overview of Ciao and its design philosophy. Theor. Pract. Logic Program. 12(1–2), 219–252 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  8. Kowalski, R., Kuehner, D.: Linear resolution with selection function. Artif. Intell. 2(3–4), 227–260 (1971)

    Article  MathSciNet  MATH  Google Scholar 

  9. Mercury. http://www.mercurylang.org/

  10. Nethercote, N., Stuckey, P.J., Becket, R., Brand, S., Duck, G.J., Tack, G.: MiniZinc: towards a standard CP modelling language. In: Principles and Practice of Constraint Programming, pp. 529–543 (2007)

    Google Scholar 

  11. Schimpf, J.: Logical loops. In: Stuckey, P.J. (ed.) ICLP 2002. LNCS, vol. 2401, pp. 224–238. Springer, Heidelberg (2002). doi:10.1007/3-540-45619-8_16

    Chapter  Google Scholar 

  12. Schimpf, J., Shen, K.: Eclipse-from LP to CLP. Theor. Pract. Logic Program. 12(1–2), 127–156 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  13. Schwartz, J.T., Dewar, R.B.K., Dubinsky, E., Schonberg, E.: Programming with Sets - An Introduction to SETL. Springer, New York (1986)

    MATH  Google Scholar 

  14. Wadler, P.: Deforestation: transforming programs to eliminate trees. Theor. Comput. Sci. 73(2), 231–248 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  15. Warren, D.H.D.: High-order extensions to Prolog - are they needed? Mach. Intell. 10, 441–454 (1982)

    Google Scholar 

  16. Warren, D.H.D.: An abstract Prolog instruction set. Technical note 309, SRI International (1983)

    Google Scholar 

  17. Zhou, N.-F.: The language features and architecture of B-Prolog. Theor. Pract. Logic Program. 12(1–2), 189–218 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  18. Zhou, N.-F., Barták, R., Dovier, A.: Planning as tabled logic programming. In: Theory and Practice of Logic Programming (2015)

    Google Scholar 

  19. Zhou, N.-F., Kjellerstrand, H.: The Picat-SAT compiler. In: Gavanelli, M., Reppy, J. (eds.) PADL 2016. LNCS, vol. 9585, pp. 48–62. Springer, Cham (2016). doi:10.1007/978-3-319-28228-2_4

    Chapter  Google Scholar 

  20. Zhou, N.-F., Kjellerstrand, H., Fruhman, J.: Constraint Solving and Planning with Picat. Springer, Heidelberg (2015)

    Book  Google Scholar 

Download references

Acknowledgement

Neng-Fa Zhou is supported in part by the NSF under the grant number CCF1618046.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Neng-Fa Zhou .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this paper

Cite this paper

Zhou, NF., Fruhman, J. (2017). Canonicalizing High-Level Constructs in Picat. In: Lierler, Y., Taha, W. (eds) Practical Aspects of Declarative Languages. PADL 2017. Lecture Notes in Computer Science(), vol 10137. Springer, Cham. https://doi.org/10.1007/978-3-319-51676-9_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-51676-9_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-51675-2

  • Online ISBN: 978-3-319-51676-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics