Subject: Re: create statement
From: Eckhardt Holz (holz#informatik.hu-berlin.de)
Date: Fri Apr 04 2003 - 10:48:57 GMT
Dear Reinhard,
There are three different kinds of creation:
1. A container agent creates a new instance of a directly contained
agent. In this case the create-statement occurs in the state machine of
the container. Its <create body> is an <agent identifier> which refers
to an <agent definition> (i.e. agent set) directly contained in the
creating agent (instance). The new instance will be added to the
addressed agent set in case of a successful creation.
In other words, a container can create its content.
2. A contained agent creates a new instance of an agent which is
contained in the same agent as the creator. In this case the <create
body> is again an agent identifier which refers to an <agent
definition>. The creator and the addressed <agent definition> are
directly contained in the same container agent. The agent set may be the
same set the creator belongs to (e.g. by using "create this") or an
other agent set directly contained in the same agent as the creator.
In other words, an agent can create its neighbours.
3. The the <create body> is an <agent type identifier>. In this case
create produces always a neighbour. However, there are two option how
the agent set to which the new instance will belong to, is selected:
a) if there are on or more explicite agent definitions based on the same
<agent type> an arbitrary set is selected at run time.
b) otherwise an implicite set will be created and the new instance will
be added to that set.
In other words, type based creation always produces neighbours.
Atleast case 1 is not covered by your proposal.
Let me give a simple example:
SYSTEM ex1;
BLOCK A;
BLOCK B; ... ENDBLOCK B;
BLOCK C; ... ENDBLOCK C;
ENDBLOCK A;
BLOCK D;
...
ENDBLOCK D;
ENDSYSTEM ex1;
in this case
A may create instances of A (this), B, C and D;
B may create instances of B and C
C may create instances of B and C
D may create instances of D and A
The creation of an A instance may implicitly lead to the creation of B
and C instances if there initial numbers are non-zero.
If we change the example to use agent type defintions there are
different possibilities to create instances:
SYSTEM ex2;
BLOCK TYPE A;
BLOCK B; ... ENDBLOCK B;
BLOCK C; ... ENDBLOCK C;
ENDBLOCK TYPE A;
BLOCK TYPE D;
...
ENDBLOCK TYPE D;
BLOCK A_Inst : A;
BLOCK D_Inst : D;
ENDSYSTEM ex2;
now we have
A may create A, B, C, D and A_Inst and D_Inst
The instances of the "Create A" will be added to
the A_Inst set (for D similar)
D may create A, D A_Inst and B_Inst
B and C may create B, C, A and D
In case of A and D two implicit agent sets will be
created in A_Inst
We would obtain the same behaviour if the block A_Inst would
have the name A (and similar for B).
Now an example with a very slight change
SYSTEM ex3;
BLOCK TYPE A;
BLOCK B; ... ENDBLOCK B;
BLOCK C; ... ENDBLOCK C;
ENDBLOCK TYPE A;
BLOCK TYPE D;
...
ENDBLOCK TYPE D;
BLOCK A_Inst : A; // !!!
BLOCK A : D; //!!!
ENDSYSTEM ex3;
now we get:
A may create A, B, C, D and A_Inst:
create A produces a new instance of D in set A
create this produces a new instance of Type A in
set A_Inst
(create <<ex4>> BLOCK TYPE A does the same)
create B and C work as before
create D produces a new instance of D in set A
create A_Inst produces a new instance of Type A in
set A_Inst
D may create A, D and A_Inst
create A produces an D
create D produces an D
create this produces an D
create A_Inst produces an A
my final example is again a modification of ex1:
SYSTEM ex4;
BLOCK A;
BLOCK B; ... ENDBLOCK B;
BLOCK C; ... ENDBLOCK C;
BLOCK D; ... ENDBLOCK D;
ENDBLOCK A;
BLOCK D;
...
ENDBLOCK D;
ENDSYSTEM ex4;
in this case
A may create instances of A (this), B, C the contained D;
To create an instance of the external D A must use
the qualified name <<ex4>> D
B may create instances of B, C and the D in A
C may create instances of B, C and the D in A
contained D create instances of B, C and the D in A
external D may create instances of (external) D and A
As you see, the selection which type the new instace has an to which
agent set it belongs depends very much on the configuration of the
system (it gets even more complicated if you take context parameters
into account or use inheritance). Therefore I think we should keep the
current wording.
Eckhardt
gotzhein#informatik.uni-kl.de wrote:
> Dear SDL experts,
>
> Recently, Ruediger Grammes, a Ph.D. student at the University of
> Kaiserslautern, has expressed interest in working on the formal
> semantics of SDL and related languages. His goal is to define a common
> formal basis, from which the formal semantics of these languages can
> then be defined by adding "semantic profiles". I would suggest to
> include him into the mailing list <meeting#sdl-forum.org>.
>
> Today, Ruediger has pointed out the following problem:
>
> -----------------------------
> In section 11.13.2 (Create) of Z.100 it is stated:
>
> "The create action causes the creation of an agent instance either
> inside the agent that performs create or in the agent that contains the
> agent that performs the create".
>
> It is not clear to me if this means that an instance of the agent
> containing the agent that performs the create action (e.g. a block
> containing the process that performs the create action) can be created,
> or that an instance of an agent contained in the same agent as the agent
> that performs create (e.g. another process in the same block) can be
> created.
>
> I think using the distinction between "agents" and "agent sets" as in
> other parts of the document could make this statement clearer, e.g.:
>
> "The create action causes the creation of an agent instance of an
> agent set that is directly contained in the agent instance
> containing the agent set of the agent instance that performs the
> create".
> -----------------------------
>
> I would like to add that the formal semantics provides a unique definition,
> which, however, may be different from the intention of SDL. If so, this should
> be corrected.
>
> Best regards,
> Reinhard
>
> ------------------------------------------------------------------------------
> Prof. Dr. Reinhard Gotzhein Tel.: (+49) 631/205-3426
> Fachbereich Informatik Fax : (+49) 631/205-3956
> Universitaet Kaiserslautern, Postfach 3049 gotzhein#informatik.uni-kl.de
> D-67653 Kaiserslautern, Germany http://rn.informatik.uni-kl.de/~gotzhein/
>
>
This archive was generated by hypermail 2a23 : Mon May 05 2008 - 20:30:55 GMT