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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 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.
- 3.
It is possible to write an infinite loop as while (true) Goal end.
- 4.
- 5.
The double negation not not is used here to discard the generated constraints after the case is done.
- 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.
- 8.
References
Colmerauer, A.: Equations and inequations on finite and infinite trees. In: Proceedings of FGCS, pp. 85–99. ICOT (1984)
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)
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)
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
Hanus, M.: Functional logic programming: from theory to curry. In: Programming Logics, pp. 123–168 (2013)
Van Hentenryck, P.: Constraint and integer programming in OPL. INFORMS J. Comput. 14, 2002 (2002)
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)
Kowalski, R., Kuehner, D.: Linear resolution with selection function. Artif. Intell. 2(3–4), 227–260 (1971)
Mercury. http://www.mercurylang.org/
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)
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
Schimpf, J., Shen, K.: Eclipse-from LP to CLP. Theor. Pract. Logic Program. 12(1–2), 127–156 (2012)
Schwartz, J.T., Dewar, R.B.K., Dubinsky, E., Schonberg, E.: Programming with Sets - An Introduction to SETL. Springer, New York (1986)
Wadler, P.: Deforestation: transforming programs to eliminate trees. Theor. Comput. Sci. 73(2), 231–248 (1990)
Warren, D.H.D.: High-order extensions to Prolog - are they needed? Mach. Intell. 10, 441–454 (1982)
Warren, D.H.D.: An abstract Prolog instruction set. Technical note 309, SRI International (1983)
Zhou, N.-F.: The language features and architecture of B-Prolog. Theor. Pract. Logic Program. 12(1–2), 189–218 (2012)
Zhou, N.-F., Barták, R., Dovier, A.: Planning as tabled logic programming. In: Theory and Practice of Logic Programming (2015)
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
Zhou, N.-F., Kjellerstrand, H., Fruhman, J.: Constraint Solving and Planning with Picat. Springer, Heidelberg (2015)
Acknowledgement
Neng-Fa Zhou is supported in part by the NSF under the grant number CCF1618046.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights 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)