Skip to content

ai-krml-uoft/indigolog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INDIGOLOG: A High-Level Programming Language for Embedded Reasoning Agents

This repo contains the INDIGOLOG interpreter and other pieces of code to enable INDIGOLOG progarms to run in external environments (e.g., Lego Mindstorm robotic platforms).

What is INDIGOLOG? INDIGOLOG is a high-level programming language for autonomous agents that sense their environment and do planning as they operate. Instead of classical planning, it supports high-level program execution. The programmer provides a high-level nondeterministic program involving domain-specific actions and tests to perform the agent's tasks. The INDIGOLOG interpreter then reasons about the preconditions and effects of the actions in the program to find a legal terminating execution. To support this, the programmer provides a declarative specification of the domain (i.e., primitive actions, preconditions and effects, what is known about the initial state) in the Situation calculus. The programmer can control the amount of non-determinism in the program and how much of it is searched over. The language is rich and supports concurrent programming. Programs are executed online together with sensing the environment and monitoring for events, thus supporting the development of reactive agents.

A report on the language and interpreter can be found in the following article:

A bit of history...

High-level programming for cognitive agents under a situation calculus theory of action stated with Golog in the late 90s, as reported in:

Later, ConGolog extended the language to include various concurrency constructs:

Giuseppe De Giacomo, Yves Lespérance, Hector J. Levesque: ConGolog, a concurrent programming language based on the situation calculus. Artificial Intelligence 121(1-2): 109-169 (2000)

However, both systems (and some variants) were meant to solve programs completely offline: a legal terminating execution of the program would be extracted before executing even the first action in the domain. To better deal with dynamic systems, INDIGOLOG proposed to execute programs online, or incrementally, by default, that is, obtain just the next legal action, perform it in the world, sense the environment, and continue. When lookahead reasoning is required, a special search construct is provided that allows to completely solve---find a full execution---a local sub-program offline. The most relevant papers on INDIGOLOG are:

Pre-requisites & setup

The INDIGOLOG engine and action theory reasoner is all written in Prolog and tested in a Linux system.

Particularly, the framework is written for SWI-Prolog (SWIPL) and makes use of several advanced features, like multi-threading and sockets, process management, stream pools, etc. So we recommend having a ful install of SWIPL, and in particular its clib library.

In Ubuntu-based system:

$ sudo apt install swi-prolog swi-prolog-nox

Some configuration variables are defined in file config.pl. In most cases this file does not need to be changed.

Dir structure

  • doc/: Documentation and manuals.
  • env/: Code forhandling of external environments (e.g., simulation, LEGO environment, ER1 environment, etc.).
  • eval/: Temporal projectors or evaluation procedures.
  • interpreters/: INDIGOLOG interpreter, including transition systems available.
  • lib/: Compatibility and tool libraries, global definitions.
  • examples/: Domain applications (e.g., elevator controller).

Application development

An application can be generally specified in a main file, e.g., main.pl that loads the following components:

  1. config.pl: general configuration settings and constants.
  2. interpreter/indigolog.pl: the main INDIGOLOG interpreter, which itself will include:
  • interpreter/env_man.pl: the environment manager in charge of starting and operating with all devices used by the application via network communication (file interpreter/env_man.pl).
  • interpreter/transfinal.pl: the transition system semantics of the INDIGOLOG language.
  1. The evaluator projector to be used, implementing predicate holds/2. For example, eval/eval_bat.pl implements a situation calculus Basic Action Theory projector.
  2. The application domain specification, including the action theory of the domain and the high-level programs to be used.

In addition, the main application domain should specify:

  1. the host and port where the environment manager should attach and communicate with the various devices to be usedl
  2. which devices to load (via load_devices/1) and how to start them up (via load_devices/2);
  3. the domain specification including the action theory and high-level program specifications;
  4. how each action term must be executed (via how_to_execute/3): in which device and under which action code to be sent to the device manager;
  5. how exogenous action messages received is to be translated to domain exogenous action terms (via translate_exog/2); and
  6. how sensing data received is to be translated to domain sending terms (via translate_sensing/3).

Additionally, the main file can set-up some configurations, like log level, via set_option/2.

The overall architecture and modules in the architecture is as follows:

INDIGOLOG architecture

Elevator Example

A full elevator example is provided in folder examples/elevator_sim which implements a controller for an elevator system executing in a simulation environment.

Instructions how to run it can be found in its readme file.

Source files are (hopefully!) significantly documented to understand the above design.

Contributors

INDIGOLOG is one of the many high-level agent-oriented programming languages developed by the Cognitive Robotics and AI-KR Group @ UofT under the direction of Hector Levesque and Ray Reiter.

About

High-level programming language with incremental execution and local search

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published