Difference between revisions of "Agents in SCOOP"
m (→Types: Added even more separate marks.) |
Peter gummer (Talk | contribs) m (Fix typo) |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
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. | 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 | + | == Status of agent targets == |
− | : Because | + | : Because any agent object is created on a processor associated with the agent's target, that target has to be controlled. |
− | '''Agent target validity rule.''' | + | '''Agent target validity rule.''' The target of an agent must be controlled. |
== Types == | == Types == | ||
− | '''Agent argument types validity rule.''' | + | '''Agent argument types validity rule.''' If an agent has a separate target, every non-expanded argument of the associated feature must be separate. |
− | : Because an agent is created on a processor of a target, without processor tags it | + | : Because an agent is created on a processor of a target, without processor tags it is 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 (see previous rule). |
− | '''Agent open target type validity rule.''' | + | '''Agent open target type validity rule.''' If the target of an agent is open, it may not be separate. |
'''Example.''' <e> | '''Example.''' <e> | ||
Line 18: | Line 18: | ||
</e> | </e> | ||
The type <e>t</e> of <e>agent t.f (c, ?)</e> is <e> | The type <e>t</e> of <e>agent t.f (c, ?)</e> is <e> | ||
− | separate FUNCTION [ | + | separate FUNCTION [ANY, TUPLE [separate Q], separate R] |
</e> | </e> | ||
− | : The separateness status of the type <e>TUPLE</e> used for arguments does not matter, what matters is the types of arguments. In many cases when <e>TUPLE</e> 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 <e>TUPLE</e>. | + | : The first parameter is not separate because the target and the agent object have the same handler. |
+ | : The separateness status of the type <e>TUPLE</e> used for arguments does not matter, what matters is the types of arguments. In many cases when <e>TUPLE</e> 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 <e>TUPLE</e>. In order to avoid unnecessary processor dependency, it's going to be created on the target processor (as a routine object itself), therefore it is not <e>separate</e>. | ||
== Agent classes == | == Agent classes == | ||
Line 27: | Line 28: | ||
'''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 [TUPLE [separate Q], separate R] |
</e> | </e> | ||
Latest revision as of 13:08, 7 May 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 agent targets
- Because any agent object is created on a processor associated with the agent's target, that target has to be controlled.
Agent target validity rule. The target of an agent must be controlled.
Types
Agent argument types validity rule. If an agent has a separate target, every non-expanded argument of the associated feature must be separate.
- Because an agent is created on a processor of a target, without processor tags it is 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 (see previous rule).
Agent open target type validity rule. If the target of an agent is open, it may not be 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 [ANY, TUPLE [separate Q], separate R]
- The first parameter is not separate because the target and the agent object have the same handler.
- 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
. In order to avoid unnecessary processor dependency, it's going to be created on the target processor (as a routine object itself), therefore it is notseparate
.
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 [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
.