[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-504882-105":59,"doc-detail-504882-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","picat-a-logic-based-multi-paradigm-language-personal-discussion","Picat - A Logic-based Multi-paradigm Language - Personal Discussion","","Picat is presented as a new general-purpose programming language that integrates logic programming, imperative programming, constraint programming, functional programming, tabling, and planning. The paper discusses key features through a set of programming examples, covering constraint programming models such as SEND+MORE=MONEY, N-queens, reification and indexing, and an optimization problem (least difference). It explains relevant syntax elements like domains, arithmetic constraints, implication, and labeling options.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/picat-a-logic-based-multi-paradigm-language-personal-discussion/504882/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/picat-a-logic-based-multi-paradigm-language-personal-discussion/504882.png","ImageObject",300,407,{"name":92,"@type":93},"Sarah ","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-21","2026-10-04",true,{"@type":102,"interactionType":103,"userInteractionCount":39},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What programming paradigms does Picat combine?","Question",{"text":112,"@type":113},"Picat combines logic programming, imperative programming, constraint programming, functional programming, plus features like tabling and planning.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How are arithmetic constraints expressed in Picat examples?",{"text":117,"@type":113},"Arithmetic constraints use a special character (shown as # in the paper), such as #> for greater-than and #= for equality.",{"name":119,"@type":110,"acceptedAnswer":120},"How does Picat solve optimization problems in the least-difference example?",{"text":121,"@type":113},"The example introduces an objective variable (Diff) and uses a labeling option like $min(Diff) so the solver minimizes the objective while generating an optimal solution.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},504882,1791324994,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":39,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":34,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":143,"read_time":144,"preview_page_count":19,"preview_urls":145},962085320529,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","Picat: A Logic-based Multi-paradigm Language  \nH􀀗akan Kjellerstrand  \nIndependent Researcher, Malmoe, Sweden  \nE-mail: [hakank@gmail.com](hakank@gmail.com)  \nJune, 2014  \nAbstract  \nPicat is a new and interesting programming language, combing many di􀀋erent and exciting programming paradigms: logic programming, imperative programming, constraint programming, functional programming, tabling, and planning. This paper gives a personal discussion of some of Picat's features with several code examples. Keywords: Picat, Constraint Programming, Logic Programming, Planning, Prolog.  \n1 INTRODUCTION  \nPicat [1] is a new programming language created by Neng-Fa Zhou and Jonathan Fruhman. The speci􀀌cation was published in December 2012 in [3] . The 􀀌rst alpha version was made available in May 2013 and the 􀀌rst stable version 0.l was released on 2014-02-01 . The current version is 0.3, which was released on 2014-05-23 .  \nI started to test Picat in May 2013 when the 􀀌rst alpha version was available. As 􀀌rst, I tested Picat's support of Constraint Programming (CP), which is a programming paradigm that I am very interested in (see for example my Constraint Programming Blog [6]) . Then, I quickly got fascinated by the complete system. In this paper, I will explain why.  \nThe name Picat is an acronym and is explained in the quote below, taken from the Picat's web site [1]: Picat is a general-purpose language that incorporates features from logic programming, functional programming, and scripting languages. The letters in the name summarize Picat's features: Pattern-matching, Imperative, Constraints, Actors, and Tabling. I would also like to emphasize the following important paradigms/features:  \nLogic-based, Planning, and Functions.  \nAll the programs and models given in this paper, including hundreds of others, are available on my My Picat Page [2] and also in my GitHub repository: [https://github.com/hakank/hakank/tree/master/picat/](https://github.com/hakank/hakank/tree/master/picat/) .  \n2 CONSTRAINTS  \nPicat has a high-level support for Constraint Programming, much like most CLP systems. Let's see how it looks like with some examples.  \n2.1 SEND+MORE=MONEY  \nLet's begin with the SEND+MORE=MONEY puzzle. In Picat it can be stated as follows:  \nimport cp .  \ngo =>  \nsendmore(Digits),  \nprintln(Digits) .  \nsendmore(Digits) =>  \nDigits = [S,E,N,D,M,O,R,Y],  \nDigits :: 0 . .9,  \nall_different(Digits),  \nS \\#> 0,  \nM \\#> 0,  \n1000*S + 100*E + 10*N + D  \n+ 1000*M + 100*O + 10*R + E  \n\\#= 10000*M + 1000*O + 100*N + 10*E + Y,  \nsolve(Digits) .  \nExcept for the =>, it's much like any C(L)P model:  \n􀀏 Domains of variables are declared by using the domain constraint Variable :: Domain.  \n􀀏 A special character (here \\#) is used to denote arithmetic constraints (e.g. , \\#> denotes greater than) .  \n􀀏 The solve predicate is used to label variables with values (labeling options can be given in solve/2) .  \n􀀏 Global constraints are used whenever appropriate (all different/1) .  \n2.2 N-queens  \nBelow is a model for the N-queens problem, a common and mandatory CP example:  \nimport cp .  \nqueens3(N, Q) => Q=new_list(N), Q :: 1 . .N, all_different(Q),  \nall_different([$Q[I]-I : I in 1   N]),  \nall_different([$Q[I]+I : I in 1   N]),  \nsolve([ff],Q) .  \nThe argument [$Q[I]-I : I in 1 . .N] is a list comprehension. Note that here we must use $Q[I]-I (i.e. Q[I] preceded with a dollar character) since it is a term, not a function call. This special notation is needed because Picat also support functions.  \nHere are the CPU times for 􀀌nding the 􀀌rst solutions for di􀀋erent values of N:  \nN=8: 0 .0s, 23 backtracks  \nN=100: 0 .03s, 22 backtracks  \nN=400: 0 .44s, 10 backtracks  \nN=1000: 2 .7s, 2 backtracks  \nN=1500: 8.7s 2889 backtracks  \nPicat is perhaps not the fastest CP system in the world, but it's quite fast.  \n2.3 Rei􀀌cations and Indexing  \nRei􀀌cation amounts to reasoning about the satis􀀌bility of constraints. It is a very important concept in Constraint Programmi","cbCaisaSGVargK9I","https://ap.wps.com/l/cbCaisaSGVargK9I","pdf",161616,"English","# Introduction\n# Constraints\n## SEND+MORE=MONEY\n## N-queens\n## Reifications and Indexing\n## The Least Diff Problem, Optimization","[{\"question\":\"What programming paradigms does Picat combine?\",\"answer\":\"Picat combines logic programming, imperative programming, constraint programming, functional programming, plus features like tabling and planning.\"},{\"question\":\"How are arithmetic constraints expressed in Picat examples?\",\"answer\":\"Arithmetic constraints use a special character (shown as # in the paper), such as #\\u003e for greater-than and #= for equality.\"},{\"question\":\"How does Picat solve optimization problems in the least-difference example?\",\"answer\":\"The example introduces an objective variable (Diff) and uses a labeling option like $min(Diff) so the solver minimizes the objective while generating an optimal solution.\"}]","Picat - A Logic-based Multi-paradigm Language - Personal Discussion | PDF",1791077225,18,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/3bbe0c39c1e4ad9e7f8b9974af6a07ad.webp",983,1272,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/e9ae2de7f22b0cfdcf8429b726829b7d.webp",982,1270,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/1c939866b22a7a10b1f2c6689d00d7cb.webp",981,1269,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/aef0950adb9d14d93b0fdb565462e6fd.webp",980,1268]