Mainstream 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 multi-paradigm (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.
The document is advertising for Python developers to join the team of a booking site for campsites and caravan parks. The company is seeking candidates to speak with them at a PyPy demo night or apply via their website. The company is leading in its market, receiving 65k daily visits and £6m in annual bookings, and has a team of 15 based in west London.
This document is the slides from a presentation introducing Ruby. It discusses what the presentation will cover which is an overview of Ruby including its history, features, syntax, and comparisons to Perl and Python. It provides a quick tour through Ruby syntax and basics like variables, data types, operators, and control structures. It also covers classes, inheritance and modules. Finally, it lists resources for learning more about Ruby.
This document is the slides from a presentation introducing Ruby. It discusses what Ruby is, its history and creator, basic syntax like variables and data types, object-oriented aspects like classes and inheritance, and compares Ruby to Perl and Python. It encourages attendees to learn Ruby hands-on and provides resources for doing so.
This document is an introduction to the Ruby programming language presented by Premshree Pillai. The presentation provides an overview of Ruby's history and features, compares it to Perl and Python, and demonstrates Ruby syntax through examples. It also provides resources for learning more about Ruby. The presentation aims to interest attendees in Ruby and help them get started with the language.
Learning R via Python…or the other way aroundSid Xing
The document discusses similarities and differences between R and Python programming languages. Both support functional and object-oriented programming paradigms. However, Python is designed more for general application development while R focuses on data analysis functions. Their syntax also differs, with Python emphasizing readability through whitespace and R favoring brevity through nesting. Examples are provided to demonstrate equivalent functionality in each language.
The document is an introduction to the Ruby programming language presented by Premshree Pillai. The presentation provides an overview of Ruby's history and basics, including its object-oriented nature, syntax, and comparisons to Perl and Python. It also provides resources for learning more about Ruby.
The document is advertising for Python developers to join the team of a booking site for campsites and caravan parks. The company is seeking candidates to speak with them at a PyPy demo night or apply via their website. The company is leading in its market, receiving 65k daily visits and £6m in annual bookings, and has a team of 15 based in west London.
This document is the slides from a presentation introducing Ruby. It discusses what the presentation will cover which is an overview of Ruby including its history, features, syntax, and comparisons to Perl and Python. It provides a quick tour through Ruby syntax and basics like variables, data types, operators, and control structures. It also covers classes, inheritance and modules. Finally, it lists resources for learning more about Ruby.
This document is the slides from a presentation introducing Ruby. It discusses what Ruby is, its history and creator, basic syntax like variables and data types, object-oriented aspects like classes and inheritance, and compares Ruby to Perl and Python. It encourages attendees to learn Ruby hands-on and provides resources for doing so.
This document is an introduction to the Ruby programming language presented by Premshree Pillai. The presentation provides an overview of Ruby's history and features, compares it to Perl and Python, and demonstrates Ruby syntax through examples. It also provides resources for learning more about Ruby. The presentation aims to interest attendees in Ruby and help them get started with the language.
Learning R via Python…or the other way aroundSid Xing
The document discusses similarities and differences between R and Python programming languages. Both support functional and object-oriented programming paradigms. However, Python is designed more for general application development while R focuses on data analysis functions. Their syntax also differs, with Python emphasizing readability through whitespace and R favoring brevity through nesting. Examples are provided to demonstrate equivalent functionality in each language.
The document is an introduction to the Ruby programming language presented by Premshree Pillai. The presentation provides an overview of Ruby's history and basics, including its object-oriented nature, syntax, and comparisons to Perl and Python. It also provides resources for learning more about Ruby.
This document provides an introduction to continuous integration using Jenkins. It discusses installing Jenkins and PHP tools like xUnit and Clover PHP. It demonstrates how to set up plugins for Git, code quality plugins like PMD and Checkstyle, and templates for PHP projects. Benefits of continuous integration mentioned include quick feedback, automation, and metrics that increase confidence. Links are provided for rating the talk, slides, code examples, and following the author on Twitter and blog.
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)Deep Learning Italia
This document provides an overview of transformer seq2seq models, including their concepts, trends, and limitations. It discusses how transformer models have replaced RNNs for seq2seq tasks due to being more parallelizable and effective at modeling long-term dependencies. Popular seq2seq models like T5, BART, and Pegasus are introduced. The document reviews common pretraining objectives for seq2seq models and current trends in larger model sizes, task-specific pretraining, and long-range modeling techniques. Limitations discussed include the need for grounded representations and efficient generation for seq2seq models.
Open Source .NET
This document introduces IronPython, the Dynamic Language Runtime (DLR), and how they enable open source development using .NET. IronPython allows Python code to run on .NET and take advantage of .NET libraries. The DLR allows multiple dynamic languages like Python, Ruby, and Lua to run on .NET. A demo is shown embedding IronPython in C#. Benefits include prototyping, rules engines, plugins, and cross-platform development using Mono.
Johnny Willemsen as CTO of Remedy IT presented this presentation to the OMG RealTime 2012 Workshop in Paris. It gives a global overview of the new IDL to C++11 language mapping
This document compares several programming languages for their suitability for bioinformatics education. It discusses trends in programming language usage over time and compares Perl, Python, Java and C++ in small bioinformatics tasks by measuring lines of code. It also evaluates these languages from a software engineering perspective. Finally, it reviews major bioinformatics libraries like BioPerl, BioPython and BioJava and their commit activity over time. The document concludes that scripting languages are better suited for teaching bioinformatics and that new languages and libraries make teaching the subject easier.
Tree-based Translation Models (『機械翻訳』§6.2-6.3)Yusuke Oda
This document discusses tree-based translation models including synchronous context free grammar (SCFG), synchronous tree substitution grammar (STSG), and synchronous parsing. It covers topics such as learning SCFG and STSG from parallel corpora, introducing syntax labels, decoding, and rescoring. Tree-to-string, string-to-tree, tree-to-tree translation models are discussed under the STSG framework. The Galley-Hopkins-Kinght-Marcu algorithm for extracting STSG rules is also summarized.
The document discusses the Delphi Runtime Library (RTL). It provides three key points:
1. The RTL is a collection of functions and procedures built into Delphi that are organized into units like SysUtils, Classes, and FileCtrl.
2. The SysUtils unit is well documented and contains many commonly used routines.
3. The RTL aims to be platform independent through conditional compilation and provides object wrappers for many routines through units like Contnrs.
Text as Data: processing the Hebrew BibleDirk Roorda
The merits of stand-off markup (LAF) versus inline markup (TEI) for processing text as data. Ideas applied to work with the Hebrew Bible, resulting in tools for researchers and end-users.
This document provides an update on the LATEX3 project in March 2014. It discusses that work has slowed on the LATEX3 codebase as team members have been busy with other tasks. However, some improvements have continued to be made, and the expl3 language is gaining wider use in packages created by external developers to solve typesetting problems. Areas of ongoing work and discussion within the project include uppercase and lowercase text manipulation and optional argument parsing.
This document summarizes a presentation about Kotlin features for Android development. It discusses Kotlin's concise syntax, null safety, lambdas, extension functions, and higher-order functions. It also covers Kotlin collections, coroutines, Anko for layouts and SQLite, and migrating existing Android projects to Kotlin. The presentation provides code examples for many of these features and recommends additional Kotlin learning resources.
Learning to Generate Pseudo-code from Source Code using Statistical Machine T...Yusuke Oda
This document summarizes a study on generating pseudo-code from source code using statistical machine translation techniques. The researchers introduced two frameworks: phrase-based machine translation and tree-to-string machine translation. Experiments were conducted on two corpora, with the tree-to-string approach modified to address issues with abstract syntax trees generating the best pseudo-code based on automatic and human evaluations. Generated pseudo-code was shown to help with code understanding tasks compared to source code alone.
Full version of http://www.slideshare.net/valexiev1/gvp-lodcidocshort. Same is available on http://vladimiralexiev.github.io/pres/20140905-CIDOC-GVP/index.html
CIDOC Congress, Dresden, Germany
2014-09-05: International Terminology Working Group: full version.
2014-09-09: Getty special session: short version
Comparing Vocabularies for Representing Geographical Features and Their GeometryGhislain Atemezing
The document compares vocabularies for representing geographical features and geometry on the semantic web. It finds that few vocabularies are widely reused, including W3C Geo, OS spatial relations, and NeoGeo. Feature modeling approaches include authority lists, SKOS categories, and domain ontologies. Geometry is modeled using points, rectangles, lists of points, and more structured representations. The document also provides recommendations for publishing French geographical data as linked data, such as using suitable ontologies to represent complex geometries and connecting features to geometry.
CIDOC Congress, Dresden, Germany
2014-09-05: International Terminology Working Group: full version (http://vladimiralexiev.github.io/pres/20140905-CIDOC-GVP/index.html)
2014-09-09: Getty special session: short version (http://VladimirAlexiev.github.io/pres/20140905-CIDOC-GVP/GVP-LOD-CIDOC-short.pdf)
ITU - MDD - Textural Languages and GrammarsTonny Madsen
This presentation describes the use and design of textural domain specific language - DSL. It has two basic purposes:
Introduce you to some of the more important design criteria in language design
Introduce you to BNF
This presentation is developed for MDD 2010 course at ITU, Denmark.
- Kotlin is a compiled, statically typed language that is interoperable with Java libraries and seamlessly bidirectional with Java.
- Kotlin offers more compile time safety compared to other statically typed languages as code will fail fast during compilation rather than at runtime.
- Kotlin has an easy learning curve for Java developers and allows freedom to mix imperative and functional programming styles.
While python is widely used for automating administration tasks, it’s not still widely known and used between system administrators.
iPython is an interactive python shell that embeds bash functionalities. We’ll show how to :
* replace some bash tasks avoiding common errors
* resembling some bash behaviour
* create testing (nose) and monitoring scripts
* use flask to expose those scripts on HTTP
Il TechAdvisor Roberto Polli condivide l'esperienza maturata su iPython, una potente shell interattiva nata per affiancare la classica shell Bash comunemente utilizzata dagli amministratori di sistema. Attraverso degli esempi pratici mostra le principali differenze tra i due approcci ed aiuta a comprendere quale sia lo strumento più adatto a specifici casi d'uso.
Durante la presentazione mostra inoltre come:
- evitare errori comuni negli script bash;
- velocizzare la creazione di script per l'esecuzione di test mediante la libreria nose;
- riutilizzare moduli Python esistenti nella shell interattiva;
- usare il framework Flask per convertire facilmente gli script in web services.
Code
http://ipython.org/
http://flask.pocoo.org/
http://nose.readthedocs.org/
https://github.com/ioggstream/dsadmin/
Babel
http://www.babel.it
http://vaunaspada.babel.it/blog
This document provides an overview of Spark Streaming concepts including microbatching and one-record-at-a-time processing models. It discusses Spark Streaming APIs, windowing, watermarks, state management, joins, sources and sinks. The key advantages of microbatching are discussed as periodic synchronization boundaries that allow task recovery and access to data in batches. Windowing, watermarks, and checkpoints are important for managing state and allowing exactly-once processing guarantees in Spark Streaming.
Reasoning with Big Knowledge Graphs: Choices, Pitfalls and Proven RecipesOntotext
This presentation will provide a brief introduction to logical reasoning and overview of the most popular semantic schema and ontology languages: RDFS and the profiles of OWL 2.
While automatic reasoning has always inspired the imagination, numerous projects have failed to deliver to the promises. The typical pitfalls related to ontologies and symbolic reasoning fall into two categories:
- Over-engineered ontologies. The selected ontology language and modeling patterns can be too expressive. This can make the results of inference hard to understand and verify, which in its turn makes KG hard to evolve and maintain. It can also impose performance penalties far greater than the benefits.
- Inappropriate reasoning support. There are many inference algorithms and implementation approaches, which work well with taxonomies and conceptual models of few thousands of concepts, but cannot cope with KG of millions of entities.
- Inappropriate data layer architecture. One such example is reasoning with virtual KG, which is often infeasible.
New Features of Python 3.10:
- What usually included in a new minor version of Python?
- Python 3.10
-- Patterns matching statement (PEP634)
-- Enabling parentheses usage in with statement
- Python 3.9
-- Union operator on dictionary data type
- Thoughts on the development of the Python language
The document discusses PostgreSQL and its capabilities. It describes how PostgreSQL was created in 1982 and became open source in 1996. It discusses PostgreSQL's support for large databases, high-performance transactions using MVCC, ACID compliance, and its ability to run on most operating systems. The document also covers PostgreSQL's JSON and NoSQL capabilities and provides performance comparisons of JSON, JSONB and text fields.
This document provides an introduction to continuous integration using Jenkins. It discusses installing Jenkins and PHP tools like xUnit and Clover PHP. It demonstrates how to set up plugins for Git, code quality plugins like PMD and Checkstyle, and templates for PHP projects. Benefits of continuous integration mentioned include quick feedback, automation, and metrics that increase confidence. Links are provided for rating the talk, slides, code examples, and following the author on Twitter and blog.
Transformer Seq2Sqe Models: Concepts, Trends & Limitations (DLI)Deep Learning Italia
This document provides an overview of transformer seq2seq models, including their concepts, trends, and limitations. It discusses how transformer models have replaced RNNs for seq2seq tasks due to being more parallelizable and effective at modeling long-term dependencies. Popular seq2seq models like T5, BART, and Pegasus are introduced. The document reviews common pretraining objectives for seq2seq models and current trends in larger model sizes, task-specific pretraining, and long-range modeling techniques. Limitations discussed include the need for grounded representations and efficient generation for seq2seq models.
Open Source .NET
This document introduces IronPython, the Dynamic Language Runtime (DLR), and how they enable open source development using .NET. IronPython allows Python code to run on .NET and take advantage of .NET libraries. The DLR allows multiple dynamic languages like Python, Ruby, and Lua to run on .NET. A demo is shown embedding IronPython in C#. Benefits include prototyping, rules engines, plugins, and cross-platform development using Mono.
Johnny Willemsen as CTO of Remedy IT presented this presentation to the OMG RealTime 2012 Workshop in Paris. It gives a global overview of the new IDL to C++11 language mapping
This document compares several programming languages for their suitability for bioinformatics education. It discusses trends in programming language usage over time and compares Perl, Python, Java and C++ in small bioinformatics tasks by measuring lines of code. It also evaluates these languages from a software engineering perspective. Finally, it reviews major bioinformatics libraries like BioPerl, BioPython and BioJava and their commit activity over time. The document concludes that scripting languages are better suited for teaching bioinformatics and that new languages and libraries make teaching the subject easier.
Tree-based Translation Models (『機械翻訳』§6.2-6.3)Yusuke Oda
This document discusses tree-based translation models including synchronous context free grammar (SCFG), synchronous tree substitution grammar (STSG), and synchronous parsing. It covers topics such as learning SCFG and STSG from parallel corpora, introducing syntax labels, decoding, and rescoring. Tree-to-string, string-to-tree, tree-to-tree translation models are discussed under the STSG framework. The Galley-Hopkins-Kinght-Marcu algorithm for extracting STSG rules is also summarized.
The document discusses the Delphi Runtime Library (RTL). It provides three key points:
1. The RTL is a collection of functions and procedures built into Delphi that are organized into units like SysUtils, Classes, and FileCtrl.
2. The SysUtils unit is well documented and contains many commonly used routines.
3. The RTL aims to be platform independent through conditional compilation and provides object wrappers for many routines through units like Contnrs.
Text as Data: processing the Hebrew BibleDirk Roorda
The merits of stand-off markup (LAF) versus inline markup (TEI) for processing text as data. Ideas applied to work with the Hebrew Bible, resulting in tools for researchers and end-users.
This document provides an update on the LATEX3 project in March 2014. It discusses that work has slowed on the LATEX3 codebase as team members have been busy with other tasks. However, some improvements have continued to be made, and the expl3 language is gaining wider use in packages created by external developers to solve typesetting problems. Areas of ongoing work and discussion within the project include uppercase and lowercase text manipulation and optional argument parsing.
This document summarizes a presentation about Kotlin features for Android development. It discusses Kotlin's concise syntax, null safety, lambdas, extension functions, and higher-order functions. It also covers Kotlin collections, coroutines, Anko for layouts and SQLite, and migrating existing Android projects to Kotlin. The presentation provides code examples for many of these features and recommends additional Kotlin learning resources.
Learning to Generate Pseudo-code from Source Code using Statistical Machine T...Yusuke Oda
This document summarizes a study on generating pseudo-code from source code using statistical machine translation techniques. The researchers introduced two frameworks: phrase-based machine translation and tree-to-string machine translation. Experiments were conducted on two corpora, with the tree-to-string approach modified to address issues with abstract syntax trees generating the best pseudo-code based on automatic and human evaluations. Generated pseudo-code was shown to help with code understanding tasks compared to source code alone.
Full version of http://www.slideshare.net/valexiev1/gvp-lodcidocshort. Same is available on http://vladimiralexiev.github.io/pres/20140905-CIDOC-GVP/index.html
CIDOC Congress, Dresden, Germany
2014-09-05: International Terminology Working Group: full version.
2014-09-09: Getty special session: short version
Comparing Vocabularies for Representing Geographical Features and Their GeometryGhislain Atemezing
The document compares vocabularies for representing geographical features and geometry on the semantic web. It finds that few vocabularies are widely reused, including W3C Geo, OS spatial relations, and NeoGeo. Feature modeling approaches include authority lists, SKOS categories, and domain ontologies. Geometry is modeled using points, rectangles, lists of points, and more structured representations. The document also provides recommendations for publishing French geographical data as linked data, such as using suitable ontologies to represent complex geometries and connecting features to geometry.
CIDOC Congress, Dresden, Germany
2014-09-05: International Terminology Working Group: full version (http://vladimiralexiev.github.io/pres/20140905-CIDOC-GVP/index.html)
2014-09-09: Getty special session: short version (http://VladimirAlexiev.github.io/pres/20140905-CIDOC-GVP/GVP-LOD-CIDOC-short.pdf)
ITU - MDD - Textural Languages and GrammarsTonny Madsen
This presentation describes the use and design of textural domain specific language - DSL. It has two basic purposes:
Introduce you to some of the more important design criteria in language design
Introduce you to BNF
This presentation is developed for MDD 2010 course at ITU, Denmark.
- Kotlin is a compiled, statically typed language that is interoperable with Java libraries and seamlessly bidirectional with Java.
- Kotlin offers more compile time safety compared to other statically typed languages as code will fail fast during compilation rather than at runtime.
- Kotlin has an easy learning curve for Java developers and allows freedom to mix imperative and functional programming styles.
While python is widely used for automating administration tasks, it’s not still widely known and used between system administrators.
iPython is an interactive python shell that embeds bash functionalities. We’ll show how to :
* replace some bash tasks avoiding common errors
* resembling some bash behaviour
* create testing (nose) and monitoring scripts
* use flask to expose those scripts on HTTP
Il TechAdvisor Roberto Polli condivide l'esperienza maturata su iPython, una potente shell interattiva nata per affiancare la classica shell Bash comunemente utilizzata dagli amministratori di sistema. Attraverso degli esempi pratici mostra le principali differenze tra i due approcci ed aiuta a comprendere quale sia lo strumento più adatto a specifici casi d'uso.
Durante la presentazione mostra inoltre come:
- evitare errori comuni negli script bash;
- velocizzare la creazione di script per l'esecuzione di test mediante la libreria nose;
- riutilizzare moduli Python esistenti nella shell interattiva;
- usare il framework Flask per convertire facilmente gli script in web services.
Code
http://ipython.org/
http://flask.pocoo.org/
http://nose.readthedocs.org/
https://github.com/ioggstream/dsadmin/
Babel
http://www.babel.it
http://vaunaspada.babel.it/blog
This document provides an overview of Spark Streaming concepts including microbatching and one-record-at-a-time processing models. It discusses Spark Streaming APIs, windowing, watermarks, state management, joins, sources and sinks. The key advantages of microbatching are discussed as periodic synchronization boundaries that allow task recovery and access to data in batches. Windowing, watermarks, and checkpoints are important for managing state and allowing exactly-once processing guarantees in Spark Streaming.
Reasoning with Big Knowledge Graphs: Choices, Pitfalls and Proven RecipesOntotext
This presentation will provide a brief introduction to logical reasoning and overview of the most popular semantic schema and ontology languages: RDFS and the profiles of OWL 2.
While automatic reasoning has always inspired the imagination, numerous projects have failed to deliver to the promises. The typical pitfalls related to ontologies and symbolic reasoning fall into two categories:
- Over-engineered ontologies. The selected ontology language and modeling patterns can be too expressive. This can make the results of inference hard to understand and verify, which in its turn makes KG hard to evolve and maintain. It can also impose performance penalties far greater than the benefits.
- Inappropriate reasoning support. There are many inference algorithms and implementation approaches, which work well with taxonomies and conceptual models of few thousands of concepts, but cannot cope with KG of millions of entities.
- Inappropriate data layer architecture. One such example is reasoning with virtual KG, which is often infeasible.
New Features of Python 3.10:
- What usually included in a new minor version of Python?
- Python 3.10
-- Patterns matching statement (PEP634)
-- Enabling parentheses usage in with statement
- Python 3.9
-- Union operator on dictionary data type
- Thoughts on the development of the Python language
The document discusses PostgreSQL and its capabilities. It describes how PostgreSQL was created in 1982 and became open source in 1996. It discusses PostgreSQL's support for large databases, high-performance transactions using MVCC, ACID compliance, and its ability to run on most operating systems. The document also covers PostgreSQL's JSON and NoSQL capabilities and provides performance comparisons of JSON, JSONB and text fields.
The document discusses the Semantic Web and Linked Data. It provides an overview of RDF syntaxes, storage and querying technologies for the Semantic Web. It also discusses issues around scalability and reasoning over large amounts of semantic data. Examples are provided to illustrate SPARQL querying of RDF data, including graph patterns, conjunctions, optional patterns and value testing.
This document describes a Contextualized Knowledge Repository (CKR) framework that allows for representing and reasoning with contextual knowledge on the Semantic Web. The CKR extends the description logic SROIQ-RL to include defeasible axioms in the global context. Defeasible axioms can be overridden by local contexts, allowing exceptions. The CKR is composed of two layers - a global context containing metadata and defeasible axioms, and local contexts containing object knowledge with references. An interpretation of a CKR maps local contexts to descriptions logic interpretations over the object vocabulary, respecting references between contexts.
TypeScript has a larger and more established community compared to KotlinJS. While Kotlin's coroutines are more powerful than TypeScript's async/await, JSX is simpler than Kotlin's React DSL. TypeScript also has a more advanced type system with features like union, intersection and mapped types. However, Kotlin has more elegant syntax with expressions like when and if being expressions. Overall, both languages are good but TypeScript is better suited as a JavaScript superset while Kotlin shines in its multiplatform capabilities.
Streams of information - Chicago crystal language monthly meetupBrian Cardiff
* Let's review and compare a couple of scenarios where data flows in and out of the system.
* What should we look at for better resource utilization?
* What have Crystal std-lib done up until now?
* What are the open questions for future work?
Traditional implementations of multiple inheritance in languages like C++ have several issues, including the diamond problem where a class inherits from two parent classes that inherit from the same grandparent, leading to ambiguity. They also have problems with name clashes when two parent classes define methods of the same name, and require glue code to connect methods across the inheritance hierarchy. More recent approaches like traits and Eiffel's method renaming try to address these issues through features like aliasing methods and dropping unwanted functionality.
The document discusses re-engineering the Eclipse MDT/OCL project to use Xtext. It describes how Xtext requires changes to the parser architecture and grammar approach used by MDT/OCL. While Xtext reduces the size of the grammar and generates editor support, it increases parser size and slows performance. The document evaluates tradeoffs and outlines ongoing work to address performance issues.
An Abstract Framework for Agent-Based Explanations in AIGiovanni Ciatto
We propose an abstract framework for XAI based on MAS encompassing the main definitions and results from the literature, focussing on the key notions of interpretation and explanation.
Towards XMAS: eXplainability through Multi-Agent SystemsGiovanni Ciatto
In the context of the Internet of Things (IoT), intelligent systems (IS) are increasingly relying on Machine Learning (ML) techniques. Given the opaqueness of most ML techniques, however, humans have to rely on their intuition to fully understand the IS outcomes: helping them is the target of eXplainable Artificial Intelligence (XAI). Current solutions – mostly too specific, and simply aimed at making ML easier to interpret – cannot satisfy the needs of IoT, characterised by heterogeneous stimuli, devices, and data-types concurring in the composition of complex information structures. Moreover, Multi-Agent Systems (MAS) achievements and advancements are most often ignored, even when they could bring about key features like explainability and trustworthiness. Accordingly, in this paper we (i) elicit and discuss the most significant issues affecting modern IS, and (ii) devise the main elements and related interconnections paving the way towards reconciling interpretable and explainable IS using MAS.
Edge Computing is rapidly gaining traction in scenarios such as Cyber-Physical Systems and Web of Things. Whereas the Cloud hides heterogeneity of devices behind its standard interfaces and protocols, the Edge should deal with it, as well as with openness and governing interactions. In this paper we propose TuSoW as a model and technology for bringing tuple-based coordination at the Edge.
Comparative Analysis of Blockchain Technologies under a Coordination PerspectiveGiovanni Ciatto
Many research works apply blockchain technologies to several different application domains ranging from supply chain and logistics to healthcare and real-estate. There, nevertheless, the blockchain performs the same two core tasks: identity management and asset tracking. In this paper we analyse how the blockchain can be exploited beyond these traditional tasks, towards coordination of distributed processes. To this end, we design and develop proof-of-concept implementations of the Linda model on top of different blockchains, and compare their strengths and shortcomings.
Smart Contracts are More than Objects: Pro-activeness on the BlockchainGiovanni Ciatto
In this this paper we focus on the expressiveness of smart contracts (SC) and its role in blockchain technologies (BCT), by presenting Tenderfone, a prototypical blockchain platform providing SC as pro-active, time-aware, and asynchronous entities.
Towards Agent-oriented Blockchains: Autonomous Smart ContractsGiovanni Ciatto
Features of blockchain technology (BCT) such as decentralisation, trust, fault tolerance, and accountability, are of paramount importance for multi-agent systems (MAS). In this paper we argue that a principled approach to MAS-BCT integration cannot overlook the foundational character of agency—that is, autonomy. Accordingly, we present a custom BCT implementation where autonomy is placed in smart contracts (SC) interpreted as software agents. We show how agency can enhance SC expressiveness with autonomy, situatedness, sociality, and intelligence, and highlight the limitations of state-of-art BCT in supporting MAS design and implementation.
This document discusses blockchain and smart contracts. It begins with an introduction to blockchain technology and how it underlies cryptocurrencies like Bitcoin. The document then covers fundamental cryptographic tools like hash functions and public-private key cryptography. It discusses how these tools can be used to build applications like timestamping services, notary services, and state machine replication. State machine replication is described as a method for replicating computations across multiple independent processors to achieve fault tolerance. Challenges of open distributed systems like message ordering and consistency are also covered.
From the Blockchain to Logic Programming and back: Research perspectivesGiovanni Ciatto
The blockchain is a novel approach to support distributed systems enabling a common, consistent view of a shared state among distributed nodes. There, smart contracts are computer programs that allow users to deploy arbitrary computations, in charge of automatically regulate state transitions and enforce properties. In this paper we speculate on how the blockchain and smart contracts could take advantage of a logic programming approach, and, complementarily, on how logic programming can benefit from the blockchain infrastructure. Accordingly, we discuss some possible research directions and open questions for future research.
Logic Programming in Space-Time: The Case of Situatedness in LPaaSGiovanni Ciatto
Situatedness is a fundamental requirement for today’s complex software systems, as well as for the computational models and programming languages used to build them. Spatial and temporal situatedness, in particular, are essential features for AI, enabling actors of the system to take autonomous decisions contextual to the space-time they live in. To support spatio-temporal awareness in distributed pervasive systems, we adopt the standpoint of Logic Programming (LP) by focussing on the Logic Programming as a Service (LPaaS) approach, promoting the distribution of situated intelligence. Accordingly, we provide an interpretation about what it means to make LP span across space and time, then we extend the LPaaS model and architecture towards spatio-temporal situatedness, by identifying a set of suitably-expressive spatio-temporal primitives.
Blockchain & Smart Contracts Basics and Perspectives for MASGiovanni Ciatto
This document discusses state machine replication and how it relates to blockchain and smart contracts. It provides background on state machine replication, including how deterministic stateful computations can be replicated across multiple nodes. It then explains how blockchain essentially provides a means for replicating deterministic stateful computations through a distributed ledger system. Smart contracts deployed on blockchain networks allow programs to be deployed and executed across the replicated ledger in a deterministic manner.
A gentle introduction to the Blockchain and Smart ContractsGiovanni Ciatto
Abstract: The blockchain is a novel approach to distributed systems enabling a common, consistent view of some shared state among distributed agents.
Smart contracts are an emerging computational model — heavily influenced by the object oriented one — allowing users to deploy arbitrary computations on a blockchain-based system.
They aim at automatically regulating (financial) interactions among individuals or organisations.
It turns out that smart contracts are essentially a novel way to perform State Machine Replication, also considering the economical aspects of computations.
Despite the very interesting applications envisioned for smart contracts — mostly related to finance, identity management or asset tracking — they are far from perfection because some characteristic traits like, for instance, semantic subtleties within the imperative code, lack control flow encapsulation, source code immutability, and so on.
In this talk we gently introduce the blockchain research area with a top-down approach, starting from a general overview of the blockchain's main elements, and moving towards a comprehensive tour of their inter-dependencies.
Finally, we present a number of research directions which are of interest for our team, mainly aimed at evaluating the consequences of combining the blockchain techonology and the smart contract abstraction with other programming paradigms and computational models.
Bitcoin, cripto-valute e altre applicazioni.
Descrizione bottom-up della tecnologia blockchain, partendo dal caso emblematico di Bitcoin e generalizzando fino agli Smart Contracts
When it is all about ERP solutions, companies typically meet their needs with common ERP solutions like SAP, Oracle, and Microsoft Dynamics. These big players have demonstrated that ERP systems can be either simple or highly comprehensive. This remains true today, but there are new factors to consider, including a promising new contender in the market that’s Odoo. This blog compares Odoo ERP with traditional ERP systems and explains why many companies now see Odoo ERP as the best choice.
What are ERP Systems?
An ERP, or Enterprise Resource Planning, system provides your company with valuable information to help you make better decisions and boost your ROI. You should choose an ERP system based on your company’s specific needs. For instance, if you run a manufacturing or retail business, you will need an ERP system that efficiently manages inventory. A consulting firm, on the other hand, would benefit from an ERP system that enhances daily operations. Similarly, eCommerce stores would select an ERP system tailored to their needs.
Because different businesses have different requirements, ERP system functionalities can vary. Among the various ERP systems available, Odoo ERP is considered one of the best in the ERp market with more than 12 million global users today.
Odoo is an open-source ERP system initially designed for small to medium-sized businesses but now suitable for a wide range of companies. Odoo offers a scalable and configurable point-of-sale management solution and allows you to create customised modules for specific industries. Odoo is gaining more popularity because it is built in a way that allows easy customisation, has a user-friendly interface, and is affordable. Here, you will cover the main differences and get to know why Odoo is gaining attention despite the many other ERP systems available in the market.
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
Measures in SQL (SIGMOD 2024, Santiago, Chile)Julian Hyde
SQL has attained widespread adoption, but Business Intelligence tools still use their own higher level languages based upon a multidimensional paradigm. Composable calculations are what is missing from SQL, and we propose a new kind of column, called a measure, that attaches a calculation to a table. Like regular tables, tables with measures are composable and closed when used in queries.
SQL-with-measures has the power, conciseness and reusability of multidimensional languages but retains SQL semantics. Measure invocations can be expanded in place to simple, clear SQL.
To define the evaluation semantics for measures, we introduce context-sensitive expressions (a way to evaluate multidimensional expressions that is consistent with existing SQL semantics), a concept called evaluation context, and several operations for setting and modifying the evaluation context.
A talk at SIGMOD, June 9–15, 2024, Santiago, Chile
Authors: Julian Hyde (Google) and John Fremlin (Google)
https://doi.org/10.1145/3626246.3653374
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
What to do when you have a perfect model for your software but you are constrained by an imperfect business model?
This talk explores the challenges of bringing modelling rigour to the business and strategy levels, and talking to your non-technical counterparts in the process.
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
SMS API Integration in Saudi Arabia| Best SMS API ServiceYara Milbes
Discover the benefits and implementation of SMS API integration in the UAE and Middle East. This comprehensive guide covers the importance of SMS messaging APIs, the advantages of bulk SMS APIs, and real-world case studies. Learn how CEQUENS, a leader in communication solutions, can help your business enhance customer engagement and streamline operations with innovative CPaaS, reliable SMS APIs, and omnichannel solutions, including WhatsApp Business. Perfect for businesses seeking to optimize their communication strategies in the digital age.
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfVALiNTRY360
Salesforce Healthcare CRM, implemented by VALiNTRY360, revolutionizes patient management by enhancing patient engagement, streamlining administrative processes, and improving care coordination. Its advanced analytics, robust security, and seamless integration with telehealth services ensure that healthcare providers can deliver personalized, efficient, and secure patient care. By automating routine tasks and providing actionable insights, Salesforce Healthcare CRM enables healthcare providers to focus on delivering high-quality care, leading to better patient outcomes and higher satisfaction. VALiNTRY360's expertise ensures a tailored solution that meets the unique needs of any healthcare practice, from small clinics to large hospital systems.
For more info visit us https://valintry360.com/solutions/health-life-sciences
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
Top 9 Trends in Cybersecurity for 2024.pptxdevvsandy
Security and risk management (SRM) leaders face disruptions on technological, organizational, and human fronts. Preparation and pragmatic execution are key for dealing with these disruptions and providing the right cybersecurity program.
SOCRadar's Aviation Industry Q1 Incident Report is out now!
The aviation industry has always been a prime target for cybercriminals due to its critical infrastructure and high stakes. In the first quarter of 2024, the sector faced an alarming surge in cybersecurity threats, revealing its vulnerabilities and the relentless sophistication of cyber attackers.
SOCRadar’s Aviation Industry, Quarterly Incident Report, provides an in-depth analysis of these threats, detected and examined through our extensive monitoring of hacker forums, Telegram channels, and dark web platforms.
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
Unveiling the Advantages of Agile Software Development.pdf
2P-Kt: logic programming with objects & functions in Kotlin
1. 2P-Kt: logic programming with objects & functions
in Kotlin
Giovanni Ciatto∗ Roberta Calegari◦ Enrico Siboni†
Enrico Denti‡ Andrea Omicini
∗‡ Dipartimento di Informatica – Scienza e Ingegneria (DISI)
◦Alma Mater Research Institute for Human-Centered Artificial Intelligence
Alma Mater Studiorum—Universit`a di Bologna, Italy
{giovanni.ciatto, roberta.calegari, enrico.denti, andrea.omicini}@unibo.it
†University of Applied Sciences and Arts of Western Switzerland (HES-SO)
enrico.siboni@hevs.ch
21st Workshop “From Objects to Agents” (WOA)
Sept. 16, 2020, Bologna, Italy
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 1 / 22
2. Motivation & Context
Next in Line. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
3 Behind the scenes
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 1 / 22
3. Motivation & Context
Context
New opportunities for logic-based technologies: (X)AI and MAS
AI side
AI is shining, brighter than ever
mostly thanks to the advances in ML and sub-symbolic AI
⇒ symbolic AI is gaining momentum because of eXplanable AI (XAI)
! hybrid solution mixing logic & data-driven AI are flourishing [3]
MAS side
The MAS community is eager for logic-based technologies [2]
to support agents’ knowledge representation, reasoning, or execution
or to prove MAS properties
! despite few mature tech. exist, and even fewer are actively maintained
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 2 / 22
4. Motivation & Context
Motivation
The problem with logic-based technologies
There is technological barrier slowing
the adoption of logic programming (LP) as paradigm
the exploitation of logic-based technologies
while programming in the large
e.g. Scala, Kotlin, Python, C#
mainstream programming languages are blending several paradigms
e.g. imperative, object-oriented (OOP), and functional programming (FP)
except LP!
mainstream platforms
e.g. JVM, .NET, JS, Python
are poorly interoperable with logic-based tech.
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 3 / 22
5. Motivation & Context
Motivating example – SWI-Prolog’s FLI for Java
Prolog [4] implementors rely on Foreign Language Interfaces (FLI) [1]
(mostly targetting Java, or C)
For instance, SWI-Prolog comes with a FLI for Java1:
Query query = new Query("parent", new Term[] {
new Atom("adam"),
new Variable("X")
}
); // ?- parent(adam, X).
Map<String,Term> solution = query.oneSolution();
System.out.println("The child of Adam is " + solution.get("X"));
→ No paradigm harmonization between Prolog and the hosting language
i.e. Java
1
https://jpl7.org
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 4 / 22
6. Motivation & Context
Contribution of the paper
Show that OOP, FP, and LP can be blended into a single language
Propose a DSL blending Kotlin (OOP + FP) and Prolog (LP)
! DSL = domain specific language
Pave the way to the creation of similar DSL in mainstream languages
eg Scala
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 5 / 22
7. Kotlin DSL for Prolog
Next in Line. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
3 Behind the scenes
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 5 / 22
8. Kotlin DSL for Prolog Overview
Focus on. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
Overview
Principles
Functioning
Advantages
3 Behind the scenes
Overview
2P-Kt
Kotlin
2P-Kt + Kotlin
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 5 / 22
9. Kotlin DSL for Prolog Overview
Whet your appetite
Our Kotlin DSL for Prolog vs. actual Prolog
prolog {
staticKb(
rule {
"ancestor"("X", "Y") `if` "parent"("X", "Y") // ancestor(X, Y) :- parent(X, Y).
}, //
rule { //
"ancestor"("X", "Y") `if` ( // ancestor(X, Y) :-
"parent"("X", "Z") and "ancestor"("Z", "Y") // parent(X, Z), ancestor(Z, Y).
) //
}, //
fact { "parent"("abraham", "isaac") }, // parent(abraham, isaac).
fact { "parent"("isaac", "jacob") }, // parent(isaac, jacob).
fact { "parent"("jacob", "joseph") } // parent(jacob, joseph).
) //
//
for (sol in solve("ancestor"("abraham", "D"))) // ?- ancestor(abraham, D),
if (sol is Solution.Yes) // write(D), nl.
println(sol.substitution["D"])
}
! try it here: https://github.com/tuProlog/prolog-dsl-example
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 6 / 22
10. Kotlin DSL for Prolog Principles
Focus on. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
Overview
Principles
Functioning
Advantages
3 Behind the scenes
Overview
2P-Kt
Kotlin
2P-Kt + Kotlin
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 6 / 22
11. Kotlin DSL for Prolog Principles
Design Principles
P1 – The DSL strictly extends the hosting language
→ no feature of the hosting language is forbidden within the DSL
P2 – The DSL is interoperable with hosting language
→ all features of the hosting language are allowed within the DSL
→ LP is harmonised with the hosting language paradigm(s)
P3 – The DSL is well encapsulated within the hosting language
→ i.e. only usable within well-identifiable sections
P4 – The DSL is as close as possible to Prolog
→ both syntactically & semantically
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 7 / 22
12. Kotlin DSL for Prolog Principles
Design Principles
P1 – The DSL strictly extends the hosting language
→ no feature of the hosting language is forbidden within the DSL
P2 – The DSL is interoperable with hosting language
→ all features of the hosting language are allowed within the DSL
→ LP is harmonised with the hosting language paradigm(s)
P3 – The DSL is well encapsulated within the hosting language
→ i.e. only usable within well-identifiable sections
P4 – The DSL is as close as possible to Prolog
→ both syntactically & semantically
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 7 / 22
13. Kotlin DSL for Prolog Principles
Design Principles
P1 – The DSL strictly extends the hosting language
→ no feature of the hosting language is forbidden within the DSL
P2 – The DSL is interoperable with hosting language
→ all features of the hosting language are allowed within the DSL
→ LP is harmonised with the hosting language paradigm(s)
P3 – The DSL is well encapsulated within the hosting language
→ i.e. only usable within well-identifiable sections
P4 – The DSL is as close as possible to Prolog
→ both syntactically & semantically
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 7 / 22
14. Kotlin DSL for Prolog Principles
Design Principles
P1 – The DSL strictly extends the hosting language
→ no feature of the hosting language is forbidden within the DSL
P2 – The DSL is interoperable with hosting language
→ all features of the hosting language are allowed within the DSL
→ LP is harmonised with the hosting language paradigm(s)
P3 – The DSL is well encapsulated within the hosting language
→ i.e. only usable within well-identifiable sections
P4 – The DSL is as close as possible to Prolog
→ both syntactically & semantically
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 7 / 22
15. Kotlin DSL for Prolog Functioning
Focus on. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
Overview
Principles
Functioning
Advantages
3 Behind the scenes
Overview
2P-Kt
Kotlin
2P-Kt + Kotlin
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 7 / 22
16. Kotlin DSL for Prolog Functioning
Functioning in the Kotlin case I
The DSL is only enabled within prolog { DSL block } expressions
there, Kotlin objects are automatically converted into Prolog terms
Expressions of the form: "functor"( e1 , e2 , . . .)
are interpreted as terms: functor(t1, t2, . . .)
provided that ∀i : ei can be converted into ti
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 8 / 22
17. Kotlin DSL for Prolog Functioning
Functioning in the Kotlin case I
The DSL is only enabled within prolog { DSL block } expressions
there, Kotlin objects are automatically converted into Prolog terms
Expressions of the form: "functor"( e1 , e2 , . . .)
are interpreted as terms: functor(t1, t2, . . .)
provided that ∀i : ei can be converted into ti
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 8 / 22
18. Kotlin DSL for Prolog Functioning
Functioning in the Kotlin case II
Expressions of the form:
rule {"head"( e1 , . . ., eN ) `if` ( eN+1 and . . . and eM ) }
are interpreted as rules: head(t1, . . . , tN) :- tN+1, . . . , tM
provided that ∀i : ei can be converted into ti
similar syntax for facts
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 9 / 22
19. Kotlin DSL for Prolog Functioning
Functioning in the Kotlin case III
Within prolog { . . . } blocks
staticKb(Clause1, Clause2, ...) sets up the local static KB
dynamicKb(Clause1, Clause2, ...) sets up the local dynamic KB
solve(Query, Timeout) returns a lazy stream of solutions
assert(Clause) appends a new clause to the local dynamic KB
. . .
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 10 / 22
20. Kotlin DSL for Prolog Functioning
Kotlin to Prolog conversions
Kotlin Object Type Prolog Term Type
lowercase string atom
uppercase string variable
int, long, short, byte integer
double, float real
boolean atom
list, array, iterable list
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 11 / 22
21. Kotlin DSL for Prolog Advantages
Focus on. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
Overview
Principles
Functioning
Advantages
3 Behind the scenes
Overview
2P-Kt
Kotlin
2P-Kt + Kotlin
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 11 / 22
22. Kotlin DSL for Prolog Advantages
Advantages of a Prolog-like DSL
No further parser / code generator / compiler is needed
Features of the hosting language can be exploited if Prolog falls short
Support tools of the hosting language can be exploited for Prolog
eg debugger, type checker, IDE, etc
Bring the power of LP to mainstream programming
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 12 / 22
23. Behind the scenes
Next in Line. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
3 Behind the scenes
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 12 / 22
24. Behind the scenes Overview
Focus on. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
Overview
Principles
Functioning
Advantages
3 Behind the scenes
Overview
2P-Kt
Kotlin
2P-Kt + Kotlin
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 12 / 22
25. Behind the scenes Overview
Recipe for a Prolog-like DSL
1 A language with a flexible API
e.g. Kotlin, Scala, Python, Groovy, etc.
2 Full fledged API for Prolog, supporting that language
e.g. 2P-Kt ! see next slide
3 Leverage flexibility to hide the exploitation of the API
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 13 / 22
26. Behind the scenes 2P-Kt
Focus on. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
Overview
Principles
Functioning
Advantages
3 Behind the scenes
Overview
2P-Kt
Kotlin
2P-Kt + Kotlin
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 13 / 22
27. Behind the scenes 2P-Kt
2P-Kt – Overview
Comprehensive, modular, re-usable API covering most aspects of LP:
unification
Unificator
mgu(Term, Term): Substitution
unify(Term, Term): Term?
match(Term, Term): Boolean
terms
Term
apply(Substitution): Term
freshCopy(): Term
Constant
value: Any
Var
name: String
Struct
functor: String
args: Array<Term>
Numeric
Integer
value: Int
Real
value: Double
Atom
value: String
Truth
isTrue: Boolean
EmptyList
List
Cons
head: Term
tail: Term
clauses & theories
Clause
head: Struct?
body: Term
RuleDirective Fact
Theory
assertA(Clause)
assertZ(Clause)
retract(Clause)
retractAll(Clause)
get(Clause): Sequence<Clause>
1
*
resolution
Solver
solve(Struct,Long): Sequence<Solution>
MutableSolver
loadStaticKb(Theory)
loadDynamicKb(Theory)
Solution
query: Struct
Yes
substitution: Unifier
No
Halt
exception: PrologError
substitutions
Substitution
get(Var): Term
contains(Var): Boolean
Unifier Fail
runs on several platforms (e.g., JVM, NodeJS, Browsers, Android)
more info here: https://github.com/tuProlog/2p-kt
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 14 / 22
28. Behind the scenes Kotlin
Focus on. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
Overview
Principles
Functioning
Advantages
3 Behind the scenes
Overview
2P-Kt
Kotlin
2P-Kt + Kotlin
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 14 / 22
29. Behind the scenes Kotlin
Kotlin mechanisms for DSL I
We exploited 4 basic mechanisms:
1 Operator overloading
interface Term {
operator fun plus(other: Term): Struct =
Struct.of("+", this, other)
}
// now one can write:
val term3: Term = term1 + term2
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 15 / 22
30. Behind the scenes Kotlin
Kotlin mechanisms for DSL II
2 Block-like lambda expressions
solutions.filter({ it -> it is Solution.Yes })
.map({ it -> it.substitution["X"] })
.joinToString(" ", { it.toString() })
// ↑ can be rewritten as ↓
solutions.filter { it is Solution.Yes }
.map { it.substitution["X"] }
.joinToString(" ") { it.toString() }
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 16 / 22
31. Behind the scenes Kotlin
Kotlin mechanisms for DSL III
3 Extension methods
fun Any.toTerm(): Term = // converts Kotlin objects into terms
operator fun String.invoke(vararg args: Term): Struct =
Struct.of(this, args.map { it.toTerm() })
// now one can write
"member"("X", arrayOf(1 .. 3)) // member(X, [1, 2, 3])
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 17 / 22
32. Behind the scenes Kotlin
Kotlin mechanisms for DSL IV
4 Function types/lambdas with receivers
class PrologDsl {
fun Any.toTerm(): Term = // ...
operator fun String.invoke(vararg args: Term): Struct = // ...
operator fun Any.plus(other: Any): Struct =
this.toTerm() + other.toTerm()
}
// ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ type with receiver
fun prolog(action: PrologDsl.() -> Any): Any =
PrologDsl().action()
// ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ lambda with receiver
prolog { "f"("1") + "f"("2") } // in braces this is PrologDsl
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 18 / 22
33. Behind the scenes Kotlin
Kotlin mechanisms for DSL V
This is a Kotlin-specific solution!
Other languages may support DSL through different mechanisms
e.g. implicits in Scala
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 19 / 22
34. Behind the scenes 2P-Kt + Kotlin
Focus on. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
Overview
Principles
Functioning
Advantages
3 Behind the scenes
Overview
2P-Kt
Kotlin
2P-Kt + Kotlin
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 19 / 22
35. Behind the scenes 2P-Kt + Kotlin
DSL design on top of 2P-Kt
JVM JS
Kotlin
2P-Kt
Prolog DSL
Scope
_: Var
varOf(String): Var
atomOf(String): Atom
structOf(String, Iterable<Term>): Struct
emptyList(): EmptyList
listOf(Iterable<Term>): List
numOf(Double): Real
numOf(Int): Integer
Prolog
Any.toTerm(): Term
String.invoke(Any, vararg Any): Struct
Substitution.get(String): Term?
PrologWithUnification
Any.mguWith(Any): Substitution
Any.matches(Any): Boolean
Any.unifyWith(Any): Term?
PrologWithTheories
theoryOf(vararg Clause): Theory
rule(PrologWithTheories.() -> Any): Rule
fact(PrologWithTheories.() -> Any): Fact
and(Any, Any): Term
or(Any, Any): Term
PrologWithResolution
solve(Any): Sequence<Solution>
solverOf(...)
member(Any, Any): Term
is(Any, Any): Term
!: Atom
fail: Atom
extends
Onion design with incremental features
Built on top of 2P-Kt and Kotlin
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 20 / 22
36. Conclusions & future works
Next in Line. . .
1 Motivation & Context
2 Kotlin DSL for Prolog
3 Behind the scenes
4 Conclusions & future works
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 20 / 22
37. Conclusions & future works
Conclusions & future works
Summing up, in this study we. . .
argued LP should be integrated in modern languages/paradigms
designed an in-language, DSL-based solution
prototyped an actual Kotlin-based DSL for Prolog
In the future, we will try to. . .
design Prolog-like DSL for other languages (e.g. Scala)
design an agent-oriented (possibly BDI?) DSL
extend 2P-Kt to support other sorts of inference mechanisms
design a logic-based API for sub-symbolic AI
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 21 / 22
38. 2P-Kt: logic programming with objects & functions
in Kotlin
Giovanni Ciatto∗ Roberta Calegari◦ Enrico Siboni†
Enrico Denti‡ Andrea Omicini
∗‡ Dipartimento di Informatica – Scienza e Ingegneria (DISI)
◦Alma Mater Research Institute for Human-Centered Artificial Intelligence
Alma Mater Studiorum—Universit`a di Bologna, Italy
{giovanni.ciatto, roberta.calegari, enrico.denti, andrea.omicini}@unibo.it
†University of Applied Sciences and Arts of Western Switzerland (HES-SO)
enrico.siboni@hevs.ch
21st Workshop “From Objects to Agents” (WOA)
Sept. 16, 2020, Bologna, Italy
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020 22 / 22
39. Bibliography
References I
[1] Roberto Bagnara and Manuel Carro.
Foreign language interfaces for Prolog: A terse survey.
ALP Newsletter, 15(2), May 2002.
[2] Roberta Calegari, Giovanni Ciatto, Viviana Mascardi, and Andrea Omicini.
Logic-based technologies for multi-agent systems: A systematic literature review.
Autonomous Agents and Multi-Agent Systems, In press.
Special Issue “Current Trends in Research on Software Agents and Agent-Based
Software Development”.
[3] Roberta Calegari, Giovanni Ciatto, and Andrea Omicini.
On the integration of symbolic and sub-symbolic techniques for XAI: A survey.
Intelligenza Artificiale, In press.
[4] Alain Colmerauer and Philippe Roussel.
The birth of prolog.
In John A. N. Lee and Jean E. Sammet, editors, History of Programming Languages
Conference (HOPL-II), pages 37–52. ACM, April 1993.
Ciatto et al. (UniBo, HES-SO) 2P-Kt: LP in Kotlin WOA, 2020