Automatic Detection of Pure Actions within the SARL Agent-Programming Language

Stéphane Galland, Nicolas Gaud · Procedia Computer Science · 2023

In computer programming, a pure function is a function that has no side-effects. Pure actions, which are assimilated to pure functions, play an important role within the SARL agent-programming language. Indeed, several constructs of the language, e.g. the guard conditions of the event handlers, cannot contain calls to unpure actions. In many existing languages, the purity of the action is declared by the developer, who could put a marker on the action in some languages, or simply implicit. The contribution of this paper is an algorithm to automatically determine if an action is pure in order to allow the SARL compiler to mark the actions as pure for the developer. The proposed algorithm is successfully implemented in the SARL compiler.

Read the paper · More papers on PaperTik