[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-505116-105":59,"doc-detail-505116-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","2p-kt-logic-programming-with-objects-functions-in-kotlin","2P-Kt - logic programming with objects & functions in Kotlin","","Mainstream programming languages increasingly support multiple paradigms, integrating object-oriented and functional programming within a single development ecosystem. Logic programming contributes substantial results for symbolic AI and multi-agent systems, yet Prolog is often accessed via foreign language interfaces. This paper proposes a domain-specific language approach that enables Kotlin object-oriented developers to use Prolog-style logic directly through a Kotlin DSL based on the interoperable 2P-Kt project.",{"@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/2p-kt-logic-programming-with-objects-functions-in-kotlin/505116/",{"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/2p-kt-logic-programming-with-objects-functions-in-kotlin/505116.png","ImageObject",300,407,{"name":92,"@type":93},"iuabcfuw","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-07","2026-10-04",true,{"@type":102,"interactionType":103,"userInteractionCount":29},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What integration approach does the paper propose for logic programming in mainstream languages?","Question",{"text":112,"@type":113},"It proposes a domain-specific language (DSL) approach that makes logic programming available to OOP programmers directly within their existing object-oriented language environment.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How is the proposed approach demonstrated in the paper?",{"text":117,"@type":113},"The paper presents a Kotlin DSL for Prolog, showing how Kotlin’s multi-paradigm capabilities (OOP and FP) can be extended with logic programming constructs in a straightforward way.",{"name":119,"@type":110,"acceptedAnswer":120},"Why does the paper argue that the integration of LP into main programming languages is increasingly relevant?",{"text":121,"@type":113},"Because existing mainstream languages already support multiple paradigms under a coherent syntax and libraries, extending them with LP can reduce adoption barriers and make logic inference and knowledge representation usable in the OOP context.","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},505116,1791441364,{"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":29,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":144,"read_time":145,"preview_page_count":19,"preview_urls":146},3985747874027,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","2P-Kt: logic programming with objects & functions in Kotlin  \nGiovanni Ciattoa , Roberta Calegarib, Enrico Sibonic, Enrico Dentia and Andrea Omicinia  \naDipartimento di Informatica – Scienza e Ingegneria (DISI), Alma Mater Studiorum—Università di Bologna, Italy  \nb Alma Mater Research Institute for Human-Centered Artificial Intelligence, Alma Mater Studiorum—Università di Bologna, Italy  \nc University of Applied Sciences and Arts of Western Switzerland (HES-SO), Sierre, Switzerland  \nAbstract  \nMainstream programming languages nowadays tends to be more and more multi-paradigm ones, by integrating diverse programming paradigms—e.g., object-oriented programming (OOP) and functional programming (FP) . Logic-programming (LP) is a successful paradigm that has contributed to many relevant results in the areas of symbolic AI and multi-agent systems, among the others. Whereas Prolog, the most successful LP language, is typically integrated with mainstream languages via foreign language interfaces, in this paper we propose an alternative approach based on the notion of domain-specific language (DSL), which makes LP available to OOP programmers straightforwardly within their OO language of choice. In particular, we present a Kotlin DSL for Prolog, showing how the Kotlin multiparadigm (OOP+FP) language can be enriched with LP in a straightforward and effective way. Since it is based on the interoperable 2P-Kt project, our technique also enables the creation of similar DSL on top of other high-level languages such as Scala or JavaScript—thus paving the way towards a more general adoption of LP in general-purpose programming environments.  \nKeywords  \nlogic programming, object-oriented programming, multi-paradigm languages, domain-specific languages, Kotlin  \n1. Introduction  \nLogic Programming (LP) [1, 2] is a programming paradigm based on formal logic, inspired to the idea of declaratively specifying a program semantics via logic formulæ, so that automatic reasoners can then prove such formulæ by leveraging on different control strategies. In the years, LP has contributed to the development of a number of diverse research fields laying under the umbrella of symbolic AI—such as automatic theorem proving, multi-agent systems, model checking, research optimisation, natural language processing, etc.  \nWOA 2020: Workshop “From Objects to Agents”, September 14 –16, 2020, Bologna, Italy  \n\" [giovanni.ciatto@unibo.it](giovanni.ciatto@unibo.it) (G. Ciatto); [roberta.calegari@unibo.it](roberta.calegari@unibo.it) (R. Calegari); [enrico.siboni@hevs.ch](enrico.siboni@hevs.ch) (E. Siboni);  \n[enrico.denti@unibo.it](enrico.denti@unibo.it) (E. Denti); [andrea.omicini@unibo.it](andrea.omicini@unibo.it) (A. Omicini)  \n~ [https://about.me/gciatto](https://about.me/gciatto) (G. Ciatto); [http://robertacalegari.apice.unibo.it](http://robertacalegari.apice.unibo.it) (R. Calegari);  \n[http://enricodenti.apice.unibo.it](http://enricodenti.apice.unibo.it) (E. Denti); [http://andreaomicini.apice.unibo.it](http://andreaomicini.apice.unibo.it) (A. Omicini)  \n􀀒 0000-0002-1841-8996 (G. Ciatto); 0000-0003-3794-2942 (R. Calegari); 0000-0003-3584-8637 (E. Siboni);  \n0000-0003-1687-8793 (E. Denti); 0000-0002-6655-3869 (A. Omicini)  \n © 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0) .  \nCWPEURorkroceshopedings http://ceurISSN 1613-ws-0073.org CEUR Workshop Proceedings ([CEUR-WS.org](CEUR-WS.org))  \nNowadays, LP is one of the major programming paradigms available for software development, along with the imperative, functional, and object-oriented ones. In particular, LP is today oneof the best-suited choices for tackling problems involving knowledge representation, logic inference, automated reasoning, search in a discrete space, or meta-programming [3] . Moreover, today LP supports the core of AI components in pervasive and distributed systems, providing intelligence where and when it is","cbCaiuqqRugrXJne","https://ap.wps.com/l/cbCaiuqqRugrXJne","pdf",1347556,18,"English","# Introduction\n## Logic programming and its role in AI\n## Motivation for integrating LP into mainstream languages\n## Interoperability with Prolog and other paradigms","[{\"question\":\"What integration approach does the paper propose for logic programming in mainstream languages?\",\"answer\":\"It proposes a domain-specific language (DSL) approach that makes logic programming available to OOP programmers directly within their existing object-oriented language environment.\"},{\"question\":\"How is the proposed approach demonstrated in the paper?\",\"answer\":\"The paper presents a Kotlin DSL for Prolog, showing how Kotlin’s multi-paradigm capabilities (OOP and FP) can be extended with logic programming constructs in a straightforward way.\"},{\"question\":\"Why does the paper argue that the integration of LP into main programming languages is increasingly relevant?\",\"answer\":\"Because existing mainstream languages already support multiple paradigms under a coherent syntax and libraries, extending them with LP can reduce adoption barriers and make logic inference and knowledge representation usable in the OOP context.\"}]","2P-Kt - logic programming with objects & functions in Kotlin | PDF",1791090507,45,[147,151,155,159],{"page_no":8,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/7909e0a5f7c380bc5973009ac9e9980d.webp",983,1390,{"page_no":14,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/ec6bd9a1f3d37a7d55a9691869c7e821.webp",982,1388,{"page_no":81,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/2ac2f2ebe1d04f3c01fa5fc2a96160e8.webp",981,1387,{"page_no":19,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/93441d11081416b2ac4c2541c1bd918e.webp",980,1385]