Agents in SCOOP

Revision as of 03:04, 20 March 2013 by Alexander Kogtenkov (Talk | contribs) (Added a page about separate agents)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The page reflects current decisions taken for the current SCOOP implementation, in particular without support for processor tags. So it may change in the future.

Types

Rule. Formal arguments of a feature used in an agent expression with a separate target should be separate.

Example.
f (p: P; q: Q): R
t: separate T
...
r := agent t.f (c, ?)
x := r.item ([a])
The type t of agent t.f (c, ?) is
separate FUNCTION [ANY, TUPLE [separate P, separate Q], separate R]
The separateness status of the type TUPLE used for arguments does not matter, what matters is the types of arguments. In many cases when TUPLE is used, it is used as a value type, i.e. it could even be an expanded type, so that a separate mark is not required. But then we need some conversion rules to attach different types of TUPLE. So far the implementation uses whatever separateness status of a TUPLE type is more suitable, most probably it is separate TUPLE.


Agent classes

The first parameter in the class ROUTINE and descendants is not used, so in the future it will be dropped altogether.

Example. The agent type from the example above becomes
separate FUNCTION [TUPLE [separate P, separate Q], separate R]


Correctness and wait conditions

The feature {ROUTINE}.precondition should be split into 2 parts: correctness_condition and wait_condition. Then the routine call looks like
call (a: OPEN_ARGS)
          require
              correctness_condition (a)
          do
              from
              until
                  not wait_condition (a)
              loop
                  execute_body (a)
              end
          end

The same change applies to the feature item.