NAL represents formalism for reasoning systems in the domain of AGI (Wang 2013, 2006; Wang and Awan 2011). NAL is a term logic with a well-defined language, the experience-based semantics, and a set of inference rules for deriving new knowledge and answering questions (Wang 2013). The term “non-axiomatic” means that the logic is suitable for the development of systems that operate in conditions of insufficient knowledge and resources. For example, it can effectively manage the inconsistent knowledge bases and summarize the existing knowledge and thus reduce the total number of statements in the database (Mitrović 2015). However, NAL is different from many other logics used to define reasoning in intelligent systems, in the sense that it is a term logic (Smith 2017; Sommers and Englebretsen 2000; Wang 2013). Its sentences are given in the form of subject-copula-predicate, where subject and predicate can be atomic or compound terms.
New knowledge is derived by using inference rules in NAL. It also used to provide answers to questions, or to deal with statement inconsistencies. These statement inconsistencies are referred to as forward, backward, and local, respectively (Wang 2013).
First of all, there is the presence of uncertainty and from time to time inconsistencies of knowledge. New evidence that can include any content can come at any time and the truth of any existing statement can be affected by it. However, this truth is not expected to converge to any value. Simultaneously, the system usually lacks enough resources, concerning space and time, to consult its entire knowledge base when solving a problem. The system cannot apply the complete set of inference rules, nor follow a predefined algorithm. Finally, the problem-solving process is localized, in the sense that only a part of statements is used to reach the conclusion.
By using built-in mechanisms for dealing with the above-mentioned issues, NAL is efficiently used to manage uncertainty and statement inconsistencies, and summarize existing knowledge so as to reduce the large amount of statements. Beside clear theoretical basis for logical reasoning, NAL is very practical and modern technology can be used for its efficient implementation.
There are 9 layers of NAL. Each layer is based on top of the previous one, and it introduces new concepts, grammar, and/or inference rules. Briefly, each layer includes the following (Wang 2013) extensions:
NAL-1: Inference rules for inheritance.
NAL-2: Similarity, instance, and property copulas.
NAL-3: Compound terms.
NAL-4: Arbitrary relations among terms.
NAL-5: Higher-order statements.
NAL-6: Variables.
NAL-7: The concept of time.
NAL-8: Support for operations, i.e. procedural statements.
NAL-9: Self-control and self-monitoring.
For more information about NAL layers, see (Wang 2013).
3.1. NAL syntax for rules 1 to 4
DNARS introduced in (Mitrović 2015) implements the concepts and inference rules of the first four NAL layers that is enough for performing cognitive tasks with practical applications.
NAL-1 introduces statements based on relations of the so-called atomic terms. Within the NAL-1, only a direct relationship is defined. It is an inheritance copula which is marked with ‘’ in DNARS. NAL-1 also introduces two-dimensional truth-value (f, c) which is written at the end of each belief. Truth-value represents the degree of consistency of any belief. Truth-value is defined with two values:
frequency (f) – proportion (i.e., percentage) of positive evidence among all evidence
confidence (c) – how stable the frequency will be when the system gains new evidence, with frequency and confidence from the interval [0-1].
An example of one belief from NAL-1 is: orange fruit (1.0, 0.9), where orange and fruit are atomic terms, ‘’ is the inheritance copula and ‘(1.0, 0.9)’ is the truth-value with f=1.0 and c=0.9. The three most important inference rules that operate on inheritance statements are deduction, induction, and abduction which are described in more detail in (Mitrović 2015; Wang 2013). Table 1 shows examples of the application of these rules.
NAL-2 introduces similarity copula which is marked with ‘~’ symbol in DNARS where similarity is a reflexive, symmetric, and transitive relation between two terms. An example of belief that contains similarity copula is: tangerine ~ clementine (0.8, 0.7), which based on truth-value, describes degree of similarity between the tangerine and the clementine. At this type of statement, tangerine ~ clementine (0.8, 0.7) is equivalent to clementine ~ tangerine (0.8, 0.7).
Table 1. Deduction, Abduction, Induction in NAL-1
Inference rules Evidences Conclusion
deduction orange fruit (f1, c1)
tangerine orange (f2, c2) tangerine fruit (f, c)
abduction orange fruit (f1, c1)
tangerine fruit (f2, c2) tangerine orange (f, c)
induction tangerine fruit (f1, c1)
tangerine orange (f2, c2) orange fruit (f, c)
Table 2. Comparison, Analogy and Resemblance inference rules
Inference rules Evidences Conclusion
comparison tangerine fruit (f1, c1)
tangerine orange (f2, c2) orange ~ fruit (f, c)
analogy orange fruit (f1, c1)
tangerine ~ orange (f2, c2) tangerine fruit (f, c)
resemblance orange ~ fruit (f1, c1)
tangerine ~ orange (f2, c2) tangerine ~ fruit (f, c)
The three most important inference rules that operate on similarity statements are comparison, analogy and resemblance. Table 2 shows examples of the application of these rules.
Truth-value is calculated using the appropriate formulas proposed in (Wang 2013). For the proposed inference rules, the formulas are given in Table 3. k is a positive constant whose proposed value is 1 (Wang 2013).
NAL-3 introduces compound terms. All the aforementioned inference rules operate on compound terms as well. A compound term consists of a connector and one or more (atomic or compound) terms.
Definition 1. A compound term has the form of {T1 con T2 con … con Tn}, where con is the connector, and T1 … Tn are terms, n ≥ 1 (Wang 2013, 2006).
In Definition 1 is a presented infix notation of the compound term. Prefix notation is also allowed and is presented in the following way: {con T1 T2 … Tn}.
Table 3. Summary of truth-value functions for syllogistic forward inference rules
Function Frequency (f) Confidence (c)
deduction f_1 f_2 f_1 f_2 c_1 c_2
abduction f_1 (f_2 c_1 c_2)/(f_2 c_1 c_2+k)
induction f_2 (f_1 c_1 c_2)/(f_1 c_1 c_2+k)
comparison (f_1 f_2)/(f_1+f_2-f_1 f_2 ) (〖(f〗_1+f_2-f_1 f_2)c_1 c_2)/(〖(f〗_1+f_2-f_1 f_2)c_1 c_2+ k)
analogy f_1 f_2 f_2 〖c_1 c〗_2
resemblance f_1 f_2 (f_1 +f_2 – f_1 f_2)c_1 c_2
In order to support arbitrary relations between terms, NAL-4 first introduces additional connector, product (x). This connector defines inheritance among individual components of a compound term (Wang 2013, 2006). Also, NAL-4 introduces relational term.
Definition 2. A relational term R is defined as an atomic term related to a product term by inheritance: (T1 x T2) R or R (T1 x T2) (Wang 2013, 2006).
For example, the sentence bees make honey can be written as (bees x honey) make. Here, make is the new relation between bees and honey.
However, some structural transformations of these kinds of sentences are often required. For example, by applying deduction to premises (herbivore x plants) eats and elephant herbivore, the system should be able to conclude that (elephant x plants) eats. Currently, this is not feasible since the rule is not able to recognize herbivore as the subject of the first premise. Therefore, it is necessary to define two new constructs, extensional image connector (/) and intensional image connector (), respectively (Mitrović 2015; Wang 2013, 2006):
((T1 x T2) R) (T1 (/ R * T2)) (T2 (/ R T1 *)) (1)
(R (T1 x T2)) (( R * T2) T1) (( R T1 *) T2) (2)
Here, the (*) symbol marks the position of either T1 or T2. The first premise can now be rewritten as herbivore (/ eats * plants). This structural transformation enables the system to conclude that elephant (/ eats * plants), or, when rewritten, that (elephant x plants) eats. By applying Equation 1, statement herbivore eats plants can be equivalently expressed in three statements:
(herbivore x plants) eats (1.0, 0.9)
herbivore (/ eats * plants) (1.0, 0.9)
plants (/ eats herbivore *) (1.0, 0.9)
Also, by applying Equation 2, statement herbivore eats plants can be equivalently expressed in three statements:
eats (herbivore x plants) (1.0, 0.9)
( eats * plants) herbivore (1.0, 0.9)
( eats herbivore *) plants (1.0, 0.9)
At the same time, these six forms of statements syntax with compound terms are supported by ALAS. Besides these types of statements, there are two more forms with atomic terms, such as:
orange fruit (1.0, 0.9)
clementine ~ tangerine (1.0, 0.9)
Besides six of the forward inference rules given above there are two local inference rules that deal with inconsistencies: revision and choice (Wang 2013, 2006, 1996). Revision is used when the two statements are derived from disjoint evidential sets, while choice is used when the sets share some elements. Given two inconsistent premises with truth-values (f1, c1) and (f2, c2), revision employs the following functions to calculate the merged statement's truth-value (Wang 2013, 2006):
f = (f1c1(1 – c2) + f2c2(1 – c1)) / (c1(1 – c2) + c2(1 – c1)) (3)
c = (c1(1 – c2) + c2(1 – c1)) / ( c1(1 – c2) + c2(1 – c1) + (1 – c1)(1 – c2)) (4)
4. Siebog middleware
In this section we briefly present Siebog, multi-agent middleware for the modern web designed and implemented at the University of Novi Sad. The main purpose of Siebog is to provide the infrastructural support for multi-agent systems with practical applications in many AI domains. It includes swarm intelligence, artificial (social) life, distributed machine learning and decision making, etc. Up-to-date principles of server and client development system are combined into a single programming framework for agents by Siebog. Siebog middleware supports both server-side, (application server-based) and client-side, (browser-based) agents. On the server side, Siebog offers automated agent load-balancing across nodes in the cluster, as well as hardware and software fault-tolerance.
On the client side, Siebog includes true platform independence, i.e. it is designed so that it can be executed on a wide variety of hardware and software platforms. Web browsers are used to execute client-side of Siebog without any external requirements (Mitrović 2015).
Siebog is developed by using the most modern technologies that have contributed that Siebog has many advantages and important features over other MAS:
Cross-platform messaging: there is the communication between client-side and server-side agents including client-side agents hosted in different browsers/devices. The communication is transparent, i.e. as if all agents are located at the same place.
Code sharing: an agent written once can be executed both on the side of client and the server.
Heterogeneous agent mobility: there is a free move of an agent between the client and the server.
Siebog is based on previous two systems, Extensible Java EE-based Agent Framework (XJAF) and Radigost also designed at the University of Novi Sad.
Radigost represents a client-side of Siebog and its agents are executed within web browsers. Radigost agents can be executed in many software and hardware devices such as mobile and smart phones, personal computers, tablets, smart TVs, etc.
XJAF represents a runtime environment that supports the execution of software agents. XJAF is an efficient environment for the execution of its agents and it provides a reusable interface for external clients. XJAF is created as a modular system containing specialized modules called managers. Each manager is a relatively independent module that handles certain agent management tasks (Mitrović, Ivanović, Vidaković, and Budimac 2014).
The flaw of XJAF Siebog component is its limitness to the Java and Java agents cannot communicate with agents that are executed in some other environment not implemented in Java. Web services are introduced and XJAF is redesigned as service-oriented architecture (SOM) in order to solve the problem of interoperability and enable wider use. However, this does not solve all the problems. Due to the fact that various programming languages are used for implementation of agent environments, it is almost impossible to write the agent that can be executed on different platforms. If the agent is written in Java and executed in SOM implemented in Java, it cannot be moved through the network in other SOM which is implemented in e.g. JavaScript or Python and continue to be executed there. To solve the problem of interoperability i.e. platform independence the authors of XJAF have developed a universal language for developing of intelligent agents – ALAS. The main purpose of ALAS is to support the implementation and execution of agents on heterogeneous platforms. To define the structure of the language, a meta-model and a grammar of the ALAS language have been created, in accordance with the requirements and needs of the agents. In this paper we described an extension of ALAS to support to DNARS (Figure 1).
Unlike other MAS based on the BDI architecture for the intelligent agents development (Bordini et al. 2009; Hindriks 2017; Hoek and Wooldridge 2013; Pokahr et al. 2014; Weiss 2013), in the last upgrade Siebog has received a support for intelligent agents in the form of a distributed system for non-axiomatic reasoning (Mitrović 2015). The main advantage of DNARS, when compared to the existing cognitive and reasoning architectures, is that it equals state-of-the-art techniques for large-scale, distributed data management and processing. This approach allows DNARS to function on top of very large knowledge bases, while serving many external clients with real-time responsiveness. In order to answer questions and derive new knowledge, DNARS includes an efficient knowledge management system, and a set of inference engines (Mitrović 2015).
After merger of XJAF and Radigost into the Siebog middleware, as well as adding logic for non-axiomatic reasoning to agents, ALAS has been updated to support new environment. To design a more efficient programming language that will be able to develop agents from narrowly specialized domains, but also to develop intelligent agents capable of deriving conclusions based on appropriate knowledge bases, we used the previously mentioned advantages of DSL and AOPL.
DNARS is a novel architecture for reasoning which can be employed for the intelligent agent development. This architecture emerged as a support to Siebog middleware by introducing agents with cognitive abilities. The main goal of these agents is to make conclusions based on large knowledge bases (Big Data) whereby these knowledge bases can often be inconsistent. DNARS intelligence is based on NAL reasoning (Wang 2013, 2006; Wang and Awan 2011), which just offers this possibility i.e. making conclusions based on large amounts of knowledge that can be uncertain, and not necessarily consistent (Mitrović 2015).
The need for processing large amounts of data requires the application of modern standards and technologies. DNARS uses NoSQL and Graph databases for processing of Big Data (Robinson, Webber, and Eifrem 2013; Sadalage and Fowler 2012; Tiwari 2011).
The latest version of DNARS presented in (Mitrović 2015) is based on the Titan (2017) distributed graph database which operates on top of Apache Cassandra (2017) database. The knowledge bases based on NAL statements can actually be represented using of the so-called property graph. The property graph contains connected nodes i.e. vertices, which can hold any number of edges (Robinson, Webber, and Eifrem 2013). It is a graph which can include different types of edges (e.g. for representing inheritance and similarity), and in which each vertex or an edge can have any number of key value pairs attached to it. Figure 2 shows an example of a set of NAL statements and the corresponding property graph.
An expressive domain-specific language named Gremlin (2017) is incorporated by Titan graph database for representing property graphs. DNARS presented in uses third-party Scala-based version of Gremlin.
In order to fill out the key requirements of AI, including an efficient processing of large amounts of knowledge, DNARS implements the main Big Data concepts such as a distributed, highly-scalable backend knowledge base, fault-tolerance realized through data replication.
In order to work with these types of knowledge bases, DNARS includes a set of algorithms that implement NAL inference rules described in Section 4. It enables DNARS to provide thousands of answers per second from a knowledge base of over 75 million statements (Mitrović 2015).
DNARS includes the concepts and inference rules of the first four NAL layers:
• First-order inheritance and similarity statements;
• Deduction, induction, abduction, comparison, analogy and resemblance;
• Choice and revision;
• Relational terms.
Designed as standalone system DNARS provides a common interface that can be easily used by any external client (human users, software agents, or some similar intelligent units). However, its main purpose is to act as a support for deliberative agents in the Siebog multi-agent framework.
Two basic components of DNARS, described in (Mitrović 2015) are DNARS inference engines and backend knowledge base.
5.1 DNARS inference engines
DNARS inference engines consist of two inference engines:
• Forward inference engine that derives new knowledge, and
• Resolution engine that answers client's questions.
The forward inference engine provides direct implementation of forward inference rules defined by NAL. External clients or an internal process can trigger inference cycle.
The resolution engine is used to answer questions and derive new knowledge for two types of questions:
(1) Questions that contain ‘?’, i.e. ‘S copula ?’ where ‘S’ is subject, or ‘? copula P’ where ‘P’ is predicate. In this case, the resolution engine inspects the system's knowledge base and finds the best substitute for ‘?’.
(2) Questions in the form of ‘S copula P’ where ‘S’ and ‘P’ are subject and predicate, respectively. The answer to this question is a statement ‘S copula P (f, c)’ where ‘f’ is frequency and ‘c’ is confidence. The engine will derive answer by using backward inference rules under condition that the answer is not directly available in the system's knowledge base.
Agent can have more answers when it making conclusions. The best possible answer is obtained by calculating the formula based on the truth-values (Definition 3).
Definition 3. The expectation of frequency, ‘e’, specifies how likely it is the value of frequency to be confirmed in the near future. It takes the value in (0, 1) and is calculated as e=(f – 1/2)c + 1/2 (Wang 2013, 2006).
5.2 Backend knowledge base
Backend knowledge base represents the system's overall knowledge base, portraying its whole experience. There are three components within backend knowledge base (Mitrović 2015):
• Short-term memory: contains statements important to the current processing cycles.
• Knowledge domain: a part of the complete knowledge base, containing interdependent or related statements.
• Event manager: notifies about the changes and manages events occurring as a result of these changes in (parts of) the knowledge base.
ALAS is agent-oriented domain-specific language for writing software and intelligent agents that are executed within Siebog multi-agent system (Mitrović, Ivanović, Vidaković, Budimac, et al. 2016; Mitrović, Ivanović, Vidaković, and Budimac 2016). Some of the most important features of the Siebog such as automated load-balancing agent, as well as hardware and software fault tolerance, require a set of new requirements that the existing agent languages do not provide. This has led to the need for the development of a new agent language for the development of intelligent agents.
ALAS is a DSL supported with elements of AI. The main idea of the language is to use it in order to writing intelligent agents from specific domains to increase efficiency and precision in solving problems and making conclusions. An important feature of ALAS compared to similar agent-oriented and domain-specific languages is the adaptability to different platforms. When the ALAS agent arrives in a program environment implemented in the X programming language, its code will be converted on the-fly into the X programming language. ALAS agents thus can be easily executed on various platforms implemented in, for example, JavaScript, Python, etc. This feature can be called hot compilation (Mitrović et al. 2012, 1212). Other important goal of ALAS is that its agents can be written using constructs specific to the appropriate domain in which an agents are being executed. In most cases, these constructs contain a set of commands that are not visible to the programmer, and in this way it hides the complexity of the overall agent-development process from developers. For example, by calling a construct, an agent actually executes a set of operations that are hidden within the construct. To design DSL with appropriate constructs, sometimes the help of an expert in that domain is needed, depending on the complexity of the domain.
The latest version of ALAS which includes support to DNARS is developed with textX (Dejanović 2017b; Dejanović et al. 2016) unlike previous versions implemented by Xtext (2017). textX has a similar notation and provides almost the same capabilities as Xtext and it has not been difficult to adapt to it. On the other hand, texX is simpler and fulfills all ALAS requirements. textX has been developed by our colleagues and there is a possibility of its upgrading in the case of new ALAS requirements. TextX is a meta-language and a tool for building domain-specific languages in Python. It is built on top of the Arpeggio PEG parser which enables unlimited lookahead, there are no ambiguities and it works as interpreter (Dejanović 2017a; Dejanović, Milosavljević, and Vaderna 2016).
With the help of mobility, an agent can leave its current host machine and continue the execution on some other machine in the network. There are different types of agent mobility depending on platforms that comprise the network (Mitrović et al. 2011). They are classified as follows:
• Homogeneous: all MAS nodes on an agent’s path are implemented on the same programming language (e.g. Java), giving the same set of APIs, etc. During the movement between the MAS nodes, the agent code needs not to be changed. Evidently, this type of migration is the easiest to handle.
• Cross-platform: all MAS nodes on an agent’s path are run on the same virtual machine offering different sets of APIs. Agent’s executable code remains the same.
• Agent-regeneration: the agent moves between instances of the same MAS, whereas MASs can be implemented by various programming languages. Because of this fact the agent’s executable code has to be regenerated when arriving to target MAS nodes.
• Heterogeneous: the agents move between different types of multi-agent systems that are running on different virtual machines or platforms and offer different sets of APIs. The agent code must be regenerated during movement between different MAS nodes.
Obviously, the heterogeneous mobility poses the most difficult technical challenges. In (Mitrović et al. 2012), the authors described supporting heterogeneous agent mobility with ALAS. Besides the corresponding constructs described in (Mitrović et al. 2012) which enable the mobility of agents, it is also necessary to enable the hot compilation process that implies the conversion of ALAS code to some other programming language described in Section 6. As noted earlier, it was difficult to create the engine for the conversion of ALAS code to some other programming language with the Xtext. Because of that, we started to develop ALAS using the textX tool. One of the main reasons for using the textX is the advantages that, Arpegio PEG parser on which the textX is based, possess. By using this parser, it is easy to access any segment of the language model. Based on this fact, it is easy to create any engine for conversion of ALAS code to any programming language. Engine construction for conversion of ALAS code to Java is described in the following section.
DSLs for software agents have been developed over the last two decades. One of the first DSLs for agents called Agent-DSL was introduced in (Kulesza et al. 2005). Agent-DSL has defined the various agent properties introduced in order to perform the appropriate tasks. Knowledge, interaction, adaptation, autonomy and collaboration were the key features of Agent-DSL.
A DSL for the development of software agents working within a semantic web environment called SEA_L (Demirkol et al. 2012; Demirkol et al. 2013) had a strong influence on the development of ALAS. SEA_L and ALAS have many common features. The original version of ALAS as well as SEA_L were developed by using the Xtext (2017) environment (Bettini 2013; Sredojević et al. 2015; Sredojević, Vidaković, and Okanović 2015; Xtext 2017). Both languages are designed for programming of the software agents in specific domains. Papers (Fowler 2010; Kosar, Bohra, and Mernik 2016) provide detailed information about a large number of DSLs that have been developed so far.
The emergence of agent technologies has led to the emergence and development of agent-oriented programming languages (AOPLs). Compared to GPLs, AOPLs offer programming constructs for agents design. The basic task of the programming constructs is hiding the complexity of some operations and enabling developers to focus on solving the specific problems. Real software systems are often based on (social) agents designed using these programming constructs (Shoham 1993).
Several languages that are mostly used as an inspiration for ALAS development are described in this section. For most other languages, see (Badica et al. 2011; Bordini et al. 2009; Dastani 2008; Dastani et al. 2004; Davies and Edwards 1994; Feraud and Galland 2017; Shoham 1993; Thomas 1995).
After AOP, AGENT0 (Shoham 1993) was the first language used for agent implementation. The main features of AGENT0 were capabilities, beliefs, and commitment rules. Agents created various actions based on messages and appropriate preconditions. The basic terms used for inter-agent communication were request, unrequest, and inform messages. In meanwhile new versions were created: PLACA (Thomas 1995) which introduced support for agent planning and Agent-k, which replaced the custom communication messages with the standardized KQML, improving the overall interoperability. These languages did not find a widely practical application, but they had a big influence on the development of many later AOPLs.
Foundation for Intelligent Physical Agents (FIPA (2017a)) made the first steps in the field of inter-agent communications. Since 2005, FIPA (2017a) is the standard for agents and multi-agent systems of the IEEE Computer Society standards organization. Siebog agents, both on the server and on the client side, communicate by exchanging messages based on the standard FIPA ACL. ALAS is designed to support FIPA ACL standard for inter-agent communication, too.
One of the first AOP languages was AgentSpeak. It’s first and foremost goal was the programming of beliefs desires-intentions (BDI) agents. It is used as an abstract framework for BDI agents as well. Originally, AgentSpeak used for understanding of the relation between practical implementations of the BDI architecture such as Procedural Reasoning System (PRS) and formalisation of the ideas behind the BDI architecture using modal logics. AgentSpeak agents communicate by exchanging messages. ALAS is inspired by this concept of inter-agent communication. The main language constructs of AgentSpeak are beliefs, goals and plans. Goals can be either test or achievement. Test goals simply query the belief base in order to determine whether some facts are true or false. Achievement goals, on the other hand, trigger the execution of plans. ALAS is also based on language constructs Some of the AgentSpeak concepts such as the difference between private and public services, had influence on ALAS development although it has never been put into practical use. AgentSpeak is gaining more and more popularity due to the development of Jason (2017), an interpreter for an extended version of the language (Bordini et al. 2009; Wang 2013).
The new AOPL based on the principles of AgentSpeak is called ASTRA (2017) and it was developed to facilitate OOP developers understanding of AOP concepts. Like AgentSpeak, ASTRA is Java-like language also based on Jason Interpreter. ASTRA constructs are mapped to methods, flow-control components, loops etc. ALAS that is also Java-like is based on the same principles as ASTRA.
One of the agent-oriented languages used to develop cognitive agents is GOAL. GOAL agents can interact with their environment and with each other. GOAL is a programming language that is based on the rules. The actions offered by GOAL are defined by the condition rules. GOAL agents are executed within multi-agent systems and communicate with each other via messages. Agents receive information about their environment through percept and can request the environment to perform actions. Cognitive agents are autonomous decision-making agents that derive their choice of action from their beliefs and goals. GOAL has emerged as an extended version of 3APL which is based on BDI, but it does not develop anymore. Most of the GOAL concepts, including the main features of GOAL agents such as beliefs, knowledge and conditions, helped in the development of ALAS.
Besides GOAL, 2APL (Dastani 2008) also emerged on 3APL concepts. One of the most important features of 2APL is the separation of multi-agent and individual agent concepts. The multi-agent part contains a set of agents, external environments, as well as relations between agents and external environments.
The basic concepts of 2APL agents are beliefs, goals, plans, events, messages, and rules. 2APL connects declarative and imperative programming styles, so it can be described as hybrid. This is the most important difference between 2APL and GOAL, since GOAL is a purely declarative programming language.
JADEX (2017) is a BDI reasoning engine whose architecture for the development of intelligent agents is based on PRS (Georgeff and Lansky 1987). JADEX agents communicate by exchanging messages. Within JADEX platform, intelligent agents can be programmed using XML or Java language. JADEX reasoning engine is very flexible and can be used in various environments. It is most commonly used within the JADE (2017) platform which is one of the most popular agent environments that are currently available to the open source community (Bellifemine, Caire, and Greenwood 2007).
Agent mobility is an essential property of agents. However, this property can be quite complex to implement. Any AOPL should hide this complexity from end-users. SAFIN (Dianxiang, Guoliang, and Xiaocong 1998) and S-CLAIM (V. Baljak 2012) (extended version of CLAIM (Suna and Fallah-Seghrouchni 2007)) hide complex support for agent mobility from the programmer. They hide the functional complexity from developers by providing them with simple, yet powerful programming constructs. These two languages are used as inspiration for the design of ALAS constructs that hide the complexity of some operations.
JACK Intelligent Agents (2017) is a cross-platform environment for rapid development of multi-agent systems. It offers new keywords and language constructs. After the compilation, pure Java code is generated whereby each agent can be viewed as the corresponding Java object. Regardless of its advantages, JACK has similar disadvantages as the Siebog: it is limited to one development platform. Both JACK and Siebog are limited to Java. Within Siebog, this problem is solved by introducing of ALAS. Design of ALAS enables development of mobile agents that are able to transform from universal ALAS code into the implementation language of the destination platform. Unlike JACK which is commercial, Siebog multi-agent middleware is free.
SARL (Feraud and Galland 2017; Rodriguez, Gaud, and Galland 2014) is new general-purpose agent-oriented programming language. Its basic tasks are providing abstractions to deal with distribution, concurrency, autonomy, interaction, reactivity, decentralization and dynamic reconfiguration. Concerning the technology and the design, SARL has significantly influenced the initial steps in ALAS developing because both of them are developed by using Xtext (2017).
Inspired by the languages described in this section and using the concepts on which they are based, ALAS has been developed. However, the basic difference between ALAS and AOPLs based on BDI architecture is that instead of BDI intelligent agents, ALAS allows development of intelligent agents based on NAL formalism developed in Artificial General Intelligence (AGI) domain (Mitrović 2015; Wang 2013, 2006).
We have introduced the early version of the ALAS programming language in papers (Mitrović et al. 2012; Mitrović, Ivanović, and Vidaković 2011; Mitrović, Ivanović, Vidaković, Sredojević, et al. 2014). This early version has used Javacc (2017) parser generator. Later versions of ALAS were developed by using Xtext framework for the language development because we wanted to start with the ECore meta-model, to separate validation from compilation and to have Eclipse plugin made for ALAS without additional programming. This plugin offers both validation and code generation to any programming language. Since the environment of the ALAS agents was implemented in Java, that was reason to design ALAS as Java-like. Due to this fact, the previous version of ALAS was developed using the Xtext because it is the most widely used tool for the development of Java-like languages. Xtext enabled a simple conversion process of ALAS code to Java as well (Sredojević et al. 2015; Sredojević, Vidaković, and Okanović 2015).
However, the problem arises when the ALAS agents move through the network and execute on various platforms implemented in different programming languages. If the agent moves, for example, to a Python platform, there will be a problem because the conversion process of the ALAS code to Python or some other language (except Java) is complicated if using Xtext. In a conversion process of ALAS code to JavaScript by using Google Web Toolkit (GWT 2017) is described. This was only a partial solution when converting ALAS code to JavaScript because it is impossible to understand the generated JavaScript code. To solve and facilitate the process of conversion of the ALAS code into any other programming language and to enable agent mobility and platform independence, the latest version of ALAS is developed by using a novel, textX framework. textX is a framework for development of domain-specific languages. It is based on Python and use Arpeggio parsing expression grammar (PEG) parser. textX automatically converts parse trees to abstract representations and thus facilitates job for developers. DSLs developed by using textX such as: pyFlies (2017), pyTabs, DprofLang and Applang had a strong influence on the ALAS developing.
One of the greatest motives of many scientists in the past 60 years was the formalization of human reasoning. As a result of testing of the human brain functions, in the middle of the 20th century, the notion of artificial intelligence (AI) emerged. At the base of AI is s complex mathematical logic that tends to present the human's way of thinking, reasoning and concluding.
An explosion of publicly available information ‘about everything’, and huge knowledge bases (e.g. Wikipedia (2017) or DBpedia (2017) as ordered knowledge base constructed on Wikipedia) but also the great progress in various domains of AI made at the beginning of the 21st century (reasoning, machine learning, expert systems, neural networks, medical diagnosis, natural language processing etc.) enabled development of computers that are capable to support such requirements.
Agent technology and intelligent agents have appeared as the research results in the field of AI in past 25 years (Serenko and Detlor 2004).
Agent technology is considered as an intelligent solution that provides autonomous and flexible problem-solving capabilities in dynamic and adaptive environments, and has been widely applied in various areas, e.g. geographical information systems, Web-based knowledge discovery systems, flood decision support systems, enterprise information system etc.
Wooldridge and Jennings (1995) are among the first predicted rapid development of intelligent agents. Many researchers have dealt with intelligent agents and there are numerous of definitions of the term ‘agent’. The common properties of most agents are (Badica et al. 2011):
• inter-agent communication within the multi-agent environment;
• as well as robots, execute assigned tasks;
• can be intelligent, generally have human-like and cognitive abilities;
• can be autonomous;
• can learn from experience;
• can act proactively as well as reactively.
Agent-oriented programming and agent-oriented programming languages (AOPL) were created to solve problems using software and intelligent agents. Up to now a lot of different agent oriented programming languages have been developed. A number of languages for coordination and communication between agents were presented in (Weiss 2001; Fowler 2010).
Often, the scope of the agent’s execution relates to various specific domains where domain-specific languages (DSLs) have a priority in programming in comparison to general-purpose languages (GPLs). A DSL is a specialized computer language focused on a particular domain and designed for a specific task (Fowler 2010). This is in contrast to general-purpose languages like C, Python, Java that are designed to let programmers write any sort of program with any sort of logic they need (Wikipedia; Fowler 2010; Hudak 1997). DSLs are used for programming in specific domains where GPL cannot solve the necessary tasks (or can, but with a lot of effort). Compared to GPLs, DSLs are more concise, more productive, code can be written more quickly, they are easier to maintain, and they are easier to reason about (Hudak 1997). The basic features that each DSL should provide are the appropriate levels of abstraction, describing logical and natural solutions but also the hiding of complexity.
In most cases, intelligent agents work in groups, communicating with each other to solve specific tasks. Software systems consisting of a set of agents that communicate with each other in order to solve the task are called multi-agent systems (MAS). MAS core functionalities include managing the agent's life-cycle, messaging, service subsystem that effectively supports agents, giving them the possibility to access resources, execute complex algorithms, and so on. In many situations, multi-agent systems offer security (e.g. agent code and data integrity as well as message encryption), a connection system that allows agents to interact in physically separated environments, mobility supporting, and persistence of agents. Agents, agent programming and multi-agent systems introduce new and unconventional ideas and concepts. According to, there are over 100 agent platforms and toolkits that were developed or are still developing.
Our motivation for research a presented in this paper is the design and implementation of the language that will increase interoperability and be platform independent. There is a number of agent languages, and the reason of developing a new one is support to the new, modern Siebog multi-agent middleware that offers support to reasoning based on DNARS and which is described in Section 4. The idea is that agents can be interoperable and can move between different nodes in the network of computers, where the nodes can be independent and implemented in different programming languages. For example, one system is implemented in Java, the second in JavaScript, the third in Python, so our goal is to develop a universal agent language whose main feature is hot compilation which will be presented in Section 5. When arriving at the destination platform, agents remember the previous state and attributes. One of the key advantages of ALAS compared to other programming languages are program constructs that replace several commands, thereby increasing the code development speed, so the code is more transparent and easy to understand for other programmers.