Syntax
[
Front page
|
List of pages
|
Search
|
Recent changes
|
Backup
|
Help
]
Start:
//[[Documentation]]
#mathjax
*Syntax [#e9c2d5d7]
**Processes [#q226387a]
An LMNtal program is written as an LMNtal process that re...
An LMNtal process is a multiset (bag) of the following:
|BGCOLOR(white):syntactic&br;category|BGCOLOR(white):form...
|BGCOLOR(white):''atoms'' | \( p(X_1,\dots,X_n) \) | a gr...
|BGCOLOR(white):''cells'' | \( \{ \textit{Process}\,\} \)...
|BGCOLOR(white):''rules'' | \( (\textit{Head}\ \texttt{:-...
The elements of a multiset are either separated by commas...
Links names are written using alphanumeric tokens startin...
(e.g., X, Res).
The other alpha-numeric tokens are treated as atom or mem...
(e.g., foo, 123).
Quoted symbols can also be used for atom or membrane names
(e.g., "foo", 'bar', [:baz:]).
Since link names stand for endpoints of one-to-one links,...
For instance, the first example below is a well-formed pr...
plus(AX,B,Y), times(A,X,AX), a(A), b(B), x(X).
p(X,Y), p(Y,Z), p(Z,X), p(U,U).
out(X), { in(X), out(Y), { in(Y), a, b }}.
LMNtal comes with a special atom '=', called a ''connecto...
***Term Notation [#je3d0553]
Atoms with '''n''' links are often used to represent ('''...
Since each link name occurs at most twice, we can abbrevi...
>\( p(s_1,\dots,s_m),\ q(t_1,\dots,t_n) \)
to
>\( p(s_1,\dots,s_{k-1}, q(t_1,\dots,t_{n-1}),s_{k+1},\do...
if \( t_n \) and \( s_k \) are the same link name. For e...
c(A,L1,L0),c(B,L2,L1),n(L2),1(A),2(B)
can be abbreviated to
c(1,c(2,n),L0).
This can be written also as
L0=c(1,c(2,n))
because LMNtal regards c(1,c(2,n),L0) and L0=L1, c(1,c(2,...
as identical (see Connectors below) and we can use the te...
Abbreviated form is provided also for membranes. For an ...
\( p(\dots, \{\dots\}, \dots) \) stands for a process
\( p(\dots, X, \dots), \{\texttt{+}X, \dots\} \) .
***List Notation [#vdc5469f]
The Prolog list syntax can be used in LMNtal.
List constructor atoms have three arguments and the name ...
For example,
'.'(A,Tmp,X), '.'(B,Rest,Tmp), '[]'(Rest)
can be abbreviated to both of the following:
X=[A,B|Rest], Rest=[]
X=[A,B]
//For some reason, the process [A,B|Rest] is parsed as
//'.'(A,Tmp), '.'(B,Rest,Tmp).
//These two atoms have different arities.
***Connectors [#kda889ac]
Binary atoms of the form X=Y are called ''connectors''. ...
// (in the sense of structural equivalence. Another insta...
// equivalence is the reordering of multiset elements.)
For example, ( p(A,X,C), X=B ) is equivalent to p(A,B,C)
as well as to ( p(A,B,X), C=X ) and C=p(A,B).
Connectors are typically used in the base case of a recur...
( append([],Y,Res) :- Res=Y ),
( append([A|X],Y,Res) :- Res=[A|R], append(X,Y,R)] )
**Rules [#f1dc70da]
The basic syntax of a rule is
>\( (\textit{Head}\ \texttt{:-}\ \textit{Body}\,) \)
The enclosing parentheses can be omitted if periods are u...
'''Head''' specifies processes to be rewritten and
'''Body''' specifies the result of rewriting.
Rules work only for the processes residing in the same me...
The full syntax of a rule that contains '''Guards'''
will be explained in [[a separate section>Guards]].
***Process Templates [#r0006ac0]
A process template is a multiset of the following:
|BGCOLOR(white):syntactic&br;category|BGCOLOR(white):form...
|BGCOLOR(white): ''atoms'' | \( p(X_1,\dots,X_n) \) | sam...
|BGCOLOR(white): ''cells'' | \( \{\textit{Template}\,\} \...
|BGCOLOR(white): ''rules'' | \( (\textit{Head}\ \texttt{:...
|BGCOLOR(white): ''process contexts'' | \( \texttt{\$}p \...
|BGCOLOR(white): ''rule contexts'' | \( @p \) | matches a...
A cell template with a membrane name only matches a cell ...
***Process Contexts [#k6234793]
A process context is a 'wildcard' for processes and repre...
The arguments \( X_1,\dots,X_n \) specify
the set of free links that must exist in the matched proc...
The optional \( *X \) represents an arbitrary number of e...
The form \( \texttt{\$}p \) is an abbreviation of \( \tex...
a multiset of atoms and cells with no constraints on the ...
free links.
A process context must occur within a membrane in a head.
Alternatively, it may either occur
- in a head and an input position of a guard, or
- in an output position of a guard.
Process contexts of the latter kinds are called ''typed p...
see [[Guards]] for details.
You can abbreviate
>\( p(s_1,\dots,s_{k-1},X,s_{k+1},\dots,s_m),\,\texttt{\$...
to
>\( p(s_1,\dots,s_{k-1},\texttt{\$}q,s_{k+1},\dots,s_m) \).
//Note that the current implementation does not fully
// support process contexts with explicit arguments.
//#comment
End:
//[[Documentation]]
#mathjax
*Syntax [#e9c2d5d7]
**Processes [#q226387a]
An LMNtal program is written as an LMNtal process that re...
An LMNtal process is a multiset (bag) of the following:
|BGCOLOR(white):syntactic&br;category|BGCOLOR(white):form...
|BGCOLOR(white):''atoms'' | \( p(X_1,\dots,X_n) \) | a gr...
|BGCOLOR(white):''cells'' | \( \{ \textit{Process}\,\} \)...
|BGCOLOR(white):''rules'' | \( (\textit{Head}\ \texttt{:-...
The elements of a multiset are either separated by commas...
Links names are written using alphanumeric tokens startin...
(e.g., X, Res).
The other alpha-numeric tokens are treated as atom or mem...
(e.g., foo, 123).
Quoted symbols can also be used for atom or membrane names
(e.g., "foo", 'bar', [:baz:]).
Since link names stand for endpoints of one-to-one links,...
For instance, the first example below is a well-formed pr...
plus(AX,B,Y), times(A,X,AX), a(A), b(B), x(X).
p(X,Y), p(Y,Z), p(Z,X), p(U,U).
out(X), { in(X), out(Y), { in(Y), a, b }}.
LMNtal comes with a special atom '=', called a ''connecto...
***Term Notation [#je3d0553]
Atoms with '''n''' links are often used to represent ('''...
Since each link name occurs at most twice, we can abbrevi...
>\( p(s_1,\dots,s_m),\ q(t_1,\dots,t_n) \)
to
>\( p(s_1,\dots,s_{k-1}, q(t_1,\dots,t_{n-1}),s_{k+1},\do...
if \( t_n \) and \( s_k \) are the same link name. For e...
c(A,L1,L0),c(B,L2,L1),n(L2),1(A),2(B)
can be abbreviated to
c(1,c(2,n),L0).
This can be written also as
L0=c(1,c(2,n))
because LMNtal regards c(1,c(2,n),L0) and L0=L1, c(1,c(2,...
as identical (see Connectors below) and we can use the te...
Abbreviated form is provided also for membranes. For an ...
\( p(\dots, \{\dots\}, \dots) \) stands for a process
\( p(\dots, X, \dots), \{\texttt{+}X, \dots\} \) .
***List Notation [#vdc5469f]
The Prolog list syntax can be used in LMNtal.
List constructor atoms have three arguments and the name ...
For example,
'.'(A,Tmp,X), '.'(B,Rest,Tmp), '[]'(Rest)
can be abbreviated to both of the following:
X=[A,B|Rest], Rest=[]
X=[A,B]
//For some reason, the process [A,B|Rest] is parsed as
//'.'(A,Tmp), '.'(B,Rest,Tmp).
//These two atoms have different arities.
***Connectors [#kda889ac]
Binary atoms of the form X=Y are called ''connectors''. ...
// (in the sense of structural equivalence. Another insta...
// equivalence is the reordering of multiset elements.)
For example, ( p(A,X,C), X=B ) is equivalent to p(A,B,C)
as well as to ( p(A,B,X), C=X ) and C=p(A,B).
Connectors are typically used in the base case of a recur...
( append([],Y,Res) :- Res=Y ),
( append([A|X],Y,Res) :- Res=[A|R], append(X,Y,R)] )
**Rules [#f1dc70da]
The basic syntax of a rule is
>\( (\textit{Head}\ \texttt{:-}\ \textit{Body}\,) \)
The enclosing parentheses can be omitted if periods are u...
'''Head''' specifies processes to be rewritten and
'''Body''' specifies the result of rewriting.
Rules work only for the processes residing in the same me...
The full syntax of a rule that contains '''Guards'''
will be explained in [[a separate section>Guards]].
***Process Templates [#r0006ac0]
A process template is a multiset of the following:
|BGCOLOR(white):syntactic&br;category|BGCOLOR(white):form...
|BGCOLOR(white): ''atoms'' | \( p(X_1,\dots,X_n) \) | sam...
|BGCOLOR(white): ''cells'' | \( \{\textit{Template}\,\} \...
|BGCOLOR(white): ''rules'' | \( (\textit{Head}\ \texttt{:...
|BGCOLOR(white): ''process contexts'' | \( \texttt{\$}p \...
|BGCOLOR(white): ''rule contexts'' | \( @p \) | matches a...
A cell template with a membrane name only matches a cell ...
***Process Contexts [#k6234793]
A process context is a 'wildcard' for processes and repre...
The arguments \( X_1,\dots,X_n \) specify
the set of free links that must exist in the matched proc...
The optional \( *X \) represents an arbitrary number of e...
The form \( \texttt{\$}p \) is an abbreviation of \( \tex...
a multiset of atoms and cells with no constraints on the ...
free links.
A process context must occur within a membrane in a head.
Alternatively, it may either occur
- in a head and an input position of a guard, or
- in an output position of a guard.
Process contexts of the latter kinds are called ''typed p...
see [[Guards]] for details.
You can abbreviate
>\( p(s_1,\dots,s_{k-1},X,s_{k+1},\dots,s_m),\,\texttt{\$...
to
>\( p(s_1,\dots,s_{k-1},\texttt{\$}q,s_{k+1},\dots,s_m) \).
//Note that the current implementation does not fully
// support process contexts with explicit arguments.
//#comment
Page: