• No results found

5.3 Perspectives

6.1.1 The Relation between ALPs and Basic Golog

A first difference between ALPs and basic Golog concerns the “feel” of the language: The former are inspired by declarative logic programming in the style of pure Prolog; the latter language is inspired by imperative programming constructs familiar from Algol.

However, basic Golog and ALPs are quite similar in that both are macro-expanded to sets of classical logical formulas that in turn provide their semantics. In the case of basic Golog the macro-expansion yields a set of first and second order Situation Calculus sentences, which can then be combined with any basic action theory in the same language. For ALPs we obtain a set of first order Horn clauses, which contain atoms from the underlying action theory, but also refer to an additional program signature.

Second Order or First Order Semantics? The major difference between the logical semantics of basic Golog and ALPs is that the former is second order, whereas the latter is first order. Capturing precisely what this difference really amounts to is not easy. But let us point out the following: In [Levesque et al., 1997] the authors give

a Golog interpreter as a Prolog program, i.e., a set of first order Horn clauses. Then they write:

“Given the simplicity of the characterization of the do predicate (in first order Horn-clauses), and the complexity of the formula that results from Do (in second order logic), a reasonable question to ask is why we even bother with the latter. The answer is that the definition of do is too weak: it is sufficient for finding a terminating situation (when it exists) given an initial one, but it cannot be used to show non-termination. Consider the program δ = [a∗; (x 6= x)]. For this program, we have that ¬Do(δ, s, s0) is entailed for any s and s0; the do predicate, however, would simply run forever.”

Here, the construct a∗ denotes non-deterministic iteration (zero or more times) of an action. Analogously, we can write the following ALP:

p.

p :- do(a), p.

Evaluating the query ?- p, ?(X \= X) is then analogous to evaluating the Golog program δ.

Certainly the authors did not mean to say that the corresponding set of first order clauses is satisfiable. But they are correct to point out that in the SLD-proof calculus (underlying Prolog and ALPs) we obtain an infinite derivation. But this seems to be a failure of the proof calculus rather, than a failure of the first order logical semantics, and hence the question about the necessity of the second order semantics remains unresolved.

On a sidenote, this discussion raises the question why we base ALPs on such a simplistic proof calculus. After all, a more clever proof calculus should be able to detect immediately that the above query will not succeed. This point may be rebutted by paraphrasing [O’Keefe, 1990] where it has been argued that Prolog is an efficient programming language because it is not a clever theorem prover. This amount to saying that, because it is easy to understand what Prolog (or ALPs) will do, the programmer should be able to recognize that the above program plus query does not make sense.

But let us get back to the discussion of the relation between the first order se- mantics of ALPs and the second order semantics of Golog: The Golog interpreter from [Levesque et al., 1997] is first order (like ALPs), while the Golog semantics is second order. But already the authors of [Levesque et al., 1997] themselves point out that it is a non-trivial task to state in which sense precisely the Golog interpreter is correct. To the best of our knowledge this relation has never been made formally precise. Likewise we were unable to derive a formal result relating the semantics of ALPs and Golog.

6.1 Golog

Inferring Plans Let us next turn to one of the commonalities of basic Golog and ALPs: Both basic Golog programs and ALPs are macro-expanded to sets of logi- cal formulas, and hence programs are not objects (terms) of the underlying action theory. Because of this it is not possible to quantify over programs, forestalling the program synthesis approach of Manna and Waldinger [Manna and Waldinger, 1987] — this observation is from [Levesque et al., 1997]. However, both Golog and ALPs can be used for planning, and the plans inferred can be regarded as simple programs. Here, the major practical difference between ALPs and basic Golog is that the former allow to infer conditional plans by appealing to the concept of a disjunctive substitution. In the planning version of Golog [Reiter, 2001a], however, the plans considered are linear. In order to fully exploit the fact that in Situation Calculus action domains a goal holds at some situation if and only if there is a conditional plan achieving the goal [Savelli, 2006], basic Golog at least needs to be modified — perhaps by admitting disjunctive substitutions in the non-deterministic choice operators.

Independence from Particular Action Calculi Another ostensible difference be- tween basic Golog and ALPs is that for the former up to now only semantics in situation-based action calculi exist, while the latter also admit action domains that are based on other time structures. It is hence worth pointing out that Golog can easily be made independent from the Situation Calculus by defining it on top of the UAC, just like the ALPs.

Separation between Strategy and Dynamic Domain Basic Golog and ALPs also differ on the issue of the separation between action domain and agent strategy. Assume we want to define a numeric measure on some fluents that currently hold to guide our strategy — say we want to count, e.g., the number of pawns we still have in the game. In basic Golog this cannot be defined, so the defining formulas have to be already present in the action domain. In ALPs the respective clauses can naturally be formulated as part of the strategy.