Difference between revisions of "Agents in SCOOP"
m (→Types: Added even more separate marks.) |
m (→Agent classes: Corrected type declaration.) |
||
Line 27: | Line 27: | ||
'''Example.''' The agent type from the example above becomes<e> | '''Example.''' The agent type from the example above becomes<e> | ||
− | separate FUNCTION [TUPLE [ | + | separate FUNCTION [separate TUPLE [separate Q], separate R] |
</e> | </e> | ||
Revision as of 10:34, 21 March 2013
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.
Status of a target
- Because a agent object is created on a processor associated with a target, this processor needs to be controlled.
Agent target validity rule. A target of an agent is controlled.
Types
Agent argument types validity rule. Formal arguments of a feature used in an agent expression with a separate target are separate.
- Because an agent is created on a processor of a target, without processor tags it's impossible to create an agent on an open target of separate type and then pass the corresponding target object at the agent call. Also there is no way to make an open target controlled.
Agent open target type validity rule. An open target of an agent is not separate.
Example.f (p: separate P; q: separate 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 [separate ANY, separate TUPLE [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 whenTUPLE
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 ofTUPLE
. So far the implementation uses whatever separateness status of aTUPLE
type is more suitable, most probably it isseparate TUPLE
.
Agent classes
The first parameter in the class ROUTINE
and descendants is not used, so in the future it will be dropped altogether.
separate FUNCTION [separate TUPLE [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 likecall (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
.