| Home > Publications > Reports > Informatics (CW) |
CW 271
B. Demoen, M. Garcia de la Banda, K. Marriott, P. Schachte and P. Stuckey
Global variables in HAL, a logic implemantation
Abstract
Recently, there has been interest in the use of (backtrackable) global variables in Prolog: they usually are presented as syntactic sugar for threaded variables and therefore their semantics is logical. However, the implementation of global variables through program transformation has some drawbacks: it is difficult to combine with separate compilation of modules and with higher order predicates. There is also a performance problem with the transformed program if the added variables are only infrequently accessed. We here describe another implementation of such global variables, within SICStus 3.0: the changes to the system are extremely small. Backtrackable global variables in HAL - a logic language with support for writing constraint solvers - allow for a particular efficient implementation of backtrackable global variables: access to their value is constant time. We also describe another type of global variables: they are non-backtrackable and their semantics depends on the execution strategy.
report.pdf / mailto: B. Demoen
