3APL

Last updated

An Abstract Agent Programming Language or Artificial Autonomous Agents Programming Language or 3APL (pronounced triple-A-P-L) is an experimental tool and programming language for the development, implementation and testing of multiple cognitive agents using the Belief-Desire-Intention (BDI) approach.

Contents

Overview

3APL was developed and is maintained by a team at the computer science department of Utrecht University in the Netherlands. It facilitates specification of cognitive agent behavior using actions, beliefs, goals, plans, and rules. It has been subject to at least 15 papers and conferences, and at least 4 theses.

Platform

The 3APL platform has a visual interface for the monitoring and debugging of agents being run therein, and a syntax-coloring editor for source code editing. It has been released as a Java-based software, which comes with some specification Java interfaces that can be used to develop Java-based plug-ins and libraries. These can be used to provide a visible representation of a virtual environment, for instance. A 3APL platform can also connect in client or server roles to other 3APL platforms across a network, to allow communication among 3APL agents on each platform. A lightweight version of 3APL for mobile applications, named 3APL-M "Toymaker", has also been released.

Language

The 3APL language is relatively simple. The syntax has basic boolean logical operators AND, OR and NOT, with IF-THEN-ELSE conditional statements, and WHILE-DO control flow loop structures. While temporary variables cannot be created except by calling plug-in methods or belief/goal conditions, iterative counter loops can be constructed using a combination of WHILE-DO loops, beliefs and capabilities.

A 3APL agent contains formal definitions of agent beliefs, capabilities, goals and plans. Specifically, there are six skeletal blocks that must be defined.

PROGRAM "agent" BELIEFBASE {} CAPABILITIES {} GOALBASE {} PLANBASE {} PG-RULES {} PR-RULES {} 

The beliefs, defined using Prolog syntax, are used to remember information and to perform logical computations. Beliefs can be read by one another, edited by the capabilities, and read by conditional statements in the plans. The initial beliefs of an agent can be defined in its belief base.

BELIEFBASE {  status(standby).  at(0,0).  location(r1,2,4).  location(r5,6,1).  dirty(r1).  dirty(r5). } 

Capabilities define the prerequisites and effects of actions in a STRIPS-like format, reading preexisting beliefs, removing some using the NOT operator, and adding new ones by stating them.

CAPABILITIES {  {status(S1)} SetStatus(S2) {NOT status(S1), status(S2)},  {at(X1,Y1)} NowAt(X2,Y2) {NOT at(X1,Y1), at(X2,Y2)},  {dirty(R)} Clean(R) {NOT dirty(R)} } 

Goals are also defined using Prolog syntax, and new goals can be adopted during runtime. Initial goals are defined in the goal base.

GOALBASE {  cleanRoom(r1).  cleanRoom(r5). } 

Each goal ideally has associated goal planning rules, its PG rules, which serve as an abstract plans and are called from the goals as long as their guard conditions are met.

PG-RULES {  cleanRoom(R) <- dirty(R) | {   SetStatus(cleaning(R));   goTo(R);   clean(R);   SetStatus(standby);  } } 

The PG rules in turn can call plan revision rules, or PR rules, which serve as subroutines, and can be called upon to execute lower level and/or repetitive tasks as long as their guard conditions are met. Initial plans are defined in the plan base, executed at the beginning of the deliberation cycle.

PLANBASE { SetStatus(started); } PR-RULES {  goTo(R) <- location(R,X,Y) AND NOT at(X,Y) | {   NowAt(X,Y);  }  clean(R) <- location(R,X,Y) AND at(X,Y) | {   Clean(R);  } } 

External methods may be called to access the environments modeled in the plug-ins. However, parameters cannot be directly passed to the methods, which means that the known environment must be correspondingly modeled in the agent's beliefs. The call returns a Prolog list, which can then be processed by the agent's own predicate logic.

Java("JanitorWorld", moveNorth(), M); 

Agents can also communicate with one another using Send commands. When a piece of information X is sent with the performative P from agent A to agent B, the sending action is recorded in A's belief base as sent(B,P,X) and is registered in B's belief base as received(A,P,X).

Send(Partner,inform,dirty(R)); 

Download

3APL is available for download at the University of Utrecht's 3APL website, packaged with sample lone and communicative agents, and a discrete multi-agent foreground environment plug-in called BlockWorld.

See also

Further reading

Related Research Articles

Logic programming is a programming paradigm which is largely based on formal logic. Any program written in a logic programming language is a set of sentences in logical form, expressing facts and rules about some problem domain. Major logic programming language families include Prolog, answer set programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:

Prolog is a logic programming language associated with artificial intelligence and computational linguistics.

POP-11 is a reflective, incrementally compiled programming language with many of the features of an interpreted language. It is the core language of the Poplog programming environment developed originally by the University of Sussex, and recently in the School of Computer Science at the University of Birmingham, which hosts the main Poplog website.

In computer programming, operators are constructs defined within programming languages which behave generally like functions, but which differ syntactically or semantically.

Constraint Handling Rules (CHR) is a declarative, rule-based programming language, introduced in 1991 by Thom Frühwirth at the time with European Computer-Industry Research Centre (ECRC) in Munich, Germany. Originally intended for constraint programming, CHR finds applications in grammar induction, type systems, abductive reasoning, multi-agent systems, natural language processing, compilation, scheduling, spatial-temporal reasoning, testing, and verification.

Answer set programming (ASP) is a form of declarative programming oriented towards difficult search problems. It is based on the stable model semantics of logic programming. In ASP, search problems are reduced to computing stable models, and answer set solvers—programs for generating stable models—are used to perform search. The computational process employed in the design of many answer set solvers is an enhancement of the DPLL algorithm and, in principle, it always terminates.

Prova is an open source programming language that combines Prolog with Java.

A "production system " is a computer program typically used to provide some form of artificial intelligence, which consists primarily of a set of rules about behavior but it also includes the mechanism necessary to follow those rules as the system responds to states of the world. Those rules, termed productions, are a basic representation found useful in automated planning, expert systems and action selection.

<span class="mw-page-title-main">Syntax (programming languages)</span> Set of rules defining correctly structured programs

In computer science, the syntax of a computer language is the rules that define the combinations of symbols that are considered to be correctly structured statements or expressions in that language. This applies both to programming languages, where the document represents source code, and to markup languages, where the document represents data.

Programming languages are used for controlling the behavior of a machine. Like natural languages, programming languages follow the rules for syntax and semantics.

This comparison of programming languages compares the features of language syntax (format) for over 50 computer programming languages.

B-Prolog was a high-performance implementation of the standard Prolog language with several extended features including matching clauses, action rules for event handling, finite-domain constraint solving, arrays and hash tables, declarative loops, and tabling. First released in 1994, B-Prolog is now a widely used CLP system. The constraint solver of B-Prolog was ranked top in two categories in the Second International Solvers Competition, and it also took the second place in P class in the second ASP solver competition and the second place overall in the third ASP solver competition. B-Prolog underpins the PRISM system, a logic-based probabilistic reasoning and learning system. B-Prolog is a commercial product, but it can be used for learning and non-profit research purposes free of charge. B-Prolog is not anymore actively developed, but it forms the basis for the Picat programming language.

Protocol Buffers (Protobuf) is a free and open-source cross-platform data format used to serialize structured data. It is useful in developing programs to communicate with each other over a network or for storing data. The method involves an interface description language that describes the structure of some data and a program that generates source code from that description for generating or parsing a stream of bytes that represents the structured data.

GOAL is an agent programming language for programming cognitive agents. GOAL agents derive their choice of action from their beliefs and goals. The language provides the basic building blocks to design and implement cognitive agents by programming constructs that allow and facilitate the manipulation of an agent's beliefs and goals and to structure its decision-making. The language provides an intuitive programming framework based on common sense or practical reasoning.

JACK Intelligent Agents is a framework in Java for multi-agent system development. JACK Intelligent Agents was built by Agent Oriented Software Pty. Ltd. (AOS) and is a third generation agent platform building on the experiences of the Procedural Reasoning System (PRS) and Distributed Multi-Agent Reasoning System (dMARS). JACK is one of the few multi-agent systems that uses the BDI software model and provides its own Java-based plan language and graphical planning tools.

The syntax and semantics of Prolog, a programming language, are the sets of rules that define how a Prolog program is written and how it is interpreted, respectively. The rules are laid out in ISO standard ISO/IEC 13211 although there are differences in the Prolog implementations.

Agent-oriented programming (AOP) is a programming paradigm where the construction of the software is centered on the concept of software agents. In contrast to object-oriented programming which has objects at its core, AOP has externally specified agents at its core. They can be thought of as abstractions of objects. Exchanged messages are interpreted by receiving "agents", in a way specific to its class of agents.

2APL is a modular BDI-based programming language that supports the development of multi-agent systems. 2APL provides a rich set of programming constructs allowing direct implementation of concepts such as beliefs, declarative goals, actions, plans, events, and reasoning rules. The reasoning rules allow run-time selection and generation of plans based on declarative goals, received events and messages, and failed plans. 2APL can be used to implement muti-agent systems consisting of software agents with reactive as well as pro-active behaviours.

Logic programming is a programming paradigm that includes languages based on formal logic, including Datalog and Prolog. This article describes the syntax and semantics of the purely declarative subset of these languages. Confusingly, the name "logic programming" also refers to a specific programming language that roughly corresponds to the declarative subset of Prolog. Unfortunately, the term must be used in both senses in this article.