- List of Backups
- View the diff.
- View the diff current.
- View the backup.
- Go to Syntax.
- 1 (2006-05-29 (Mon) 02:27:45)
- 2 (2006-07-23 (Sun) 05:04:00)
- 3 (2006-11-02 (Thu) 10:18:38)
- 4 (2006-11-02 (Thu) 10:18:38)
- 5 (2010-06-10 (Thu) 04:31:49)
- 6 (2010-06-10 (Thu) 04:31:49)
- 7 (2010-06-10 (Thu) 04:31:49)
- 8 (2010-06-10 (Thu) 04:31:49)
- 9 (2010-06-16 (Wed) 15:18:28)
- 10 (2010-06-16 (Wed) 15:18:28)
*11 (2012-05-10 (Thu) 06:33:37)*- 12 (2012-05-10 (Thu) 16:34:28)
- 13 (2012-05-11 (Fri) 02:32:29)
- 14 (2012-05-11 (Fri) 02:32:29)
- 15 (2017-03-02 (Thu) 03:32:49)
- 16 (2019-04-29 (Mon) 16:56:13)
- 17 (2019-04-30 (Tue) 08:35:18)
- 18 (2019-05-01 (Wed) 09:24:21)
- 19 (2019-05-01 (Wed) 15:58:22)
- 20 (2019-06-28 (Fri) 07:38:42)

//[[Documentation]] *Syntax **Processes An LMNtal process is a multiset (unordered sequence) of the following: |BGCOLOR(white):syntactic&br;category|BGCOLOR(white):form|BGCOLOR(white):description| |BGCOLOR(white):''atoms'' | '''p'''('''X'''&size(10){1};, ..., '''X'''&size(10){'''n'''};) | a graph node with a symbolic ''name'' '''p''' and an ordered sequence of ''links'' '''X'''&size(10){'''i'''}; | |BGCOLOR(white):''cells'' | { '''Process''' }&br;'''m'''{ '''Process''' } | a process enclosed with a ''membrane'' (curly braces),&br;optionally with a membrane name '''m''' | |BGCOLOR(white):''rules'' | ( '''Head''' :- '''Body''' ) | a rewrite rule for processes, explained below | Both periods (as separators) and commas (as terminators) can be used to sequence the elements of a multiset. An LMNtal program is written as an LMNtal process. Links are written using alphanumeric tokens starting with capital letters (e.g., X, Res). The other alpha-numeric tokens are treated as names (e.g., foo, 123). Quoted symbols can also be used for atom names (e.g., "foo", 'bar', [:baz:]). ***Term Abbreviation Scheme Each link has at most two occurrences. This enables us to abbreviate >'''p'''('''s'''&size(10){1};, ..., '''s'''&size(10){'''m'''};), '''q'''('''t'''&size(10){1};, ..., '''t'''&size(10){'''n'''};) to >'''p'''('''s'''&size(10){1};, ..., '''s'''&size(10){'''k'''-1};, '''q'''('''t'''&size(10){1};, ..., '''t'''&size(10){'''n'''-1};), '''s'''&size(10){'''k'''+1};, ..., '''s'''&size(10){'''m'''};) // &math(p(s_1,\ldots,s_m), q(t_1,\ldots,t_n)); to // &math(p(s_1,\ldots,s_{k-1},q(t_1,\ldots,t_{n-1}), s_{k+1},\ldots,s_m)); if '''t'''&size(10){'''n'''}; and '''s'''&size(10){'''k'''}; are the same link. For example, c(1,c(2,n),L0) is an abbreviation of c(A,L1,L0),c(B,L2,L1),n(L2),1(A),2(B). This can be written also as L0=c(1,c(2,n)) . For an atom name '''p''' and a membrane, '''p'''(..., {...}, ...) stands for a molecule '''p'''(..., X, ...), {+X, ...} . ***List Notation The Prolog list syntax can be used in LMNtal. List constructor atoms have three arguments and the name '.' . X=[A,B|Rest], Rest=[] and X=[A,B] are abbreviated forms of '.'(A,Tmp,X), '.'(B,Rest,Tmp), '[]'(Rest). //For some reason, the process [A,B|Rest] is parsed as //'.'(A,Tmp), '.'(B,Rest,Tmp). //These two atoms have different arities. ***Connector Atoms Binary atoms with the name = of the form X=Y are called ''connector atoms''. Connector atoms state that the two links in the arguments are identical (in the sense of structural equivalence. Another instance of structural equivalence is the reordering of multiset elements.) For example, ( p(A,X,C), X=B ) is always equivalent to p(A,B,C), as well as to ( p(A,B,X), C=X ), and, finally, to C=p(A,B). The typical usage of connector atoms can be found in the following example: ( Res=append([],Y) :- Res=Y ), ( Res=append([A|X],Y) :- Res=[A|append(X,Y)] ) **Rules The basic syntax of a rule is >( '''Head''' :- '''Body''' ). The enclosing parentheses can be omitted if periods are used to delimit the rule. Both of '''Head''' and '''Body''' are ''process templates''. '''Head''' specifies processes to be rewritten and '''Body''' specifies the result of rewriting. Rules work only for the processes residing in the same membrane. The full syntax of a rule that contains '''Guard''' part will be explained later in [[a separate section>Guards]]. ***Process Templates A process template is a multiset of the following: |BGCOLOR(white):syntactic&br;category|BGCOLOR(white):form|BGCOLOR(white):description| |BGCOLOR(white): ''atoms'' | '''p'''('''X'''&size(10){1};, ..., '''X'''&size(10){'''n'''};) | same as in a process | |BGCOLOR(white): ''cells'' | { '''Template''' }&br;{ '''Template''' }/&br;'''m'''{ '''Template''' }&br;'''m'''{ '''Template''' }/ | a process template enclosed with a membrane | |BGCOLOR(white): ''rules'' | ( '''Head''' :- '''Body''' ) | allowed only in a Body | |BGCOLOR(white): ''process contexts'' | $'''p'''&br;$'''p'''['''X'''&size(10){1};, ..., '''X'''&size(10){'''n'''};]&br;$'''p'''['''X'''&size(10){1};, ..., '''X'''&size(10){'''n'''};|*'''X'''] | matches a multiset of atoms and cells (see below) | |BGCOLOR(white): ''rule contexts'' | @'''p''' | matches a multiset of rules | A cell template with a membrane name only matches a cell with the same membrane name. A cell template with '/' (the stable flag) only matches a ''stable'' cell, i.e., a cell containing no applicable rules inside it. ***Process Contexts A process context represents a multiset of atoms and cells. The arguments '''X'''&size(10){1};, ..., '''X'''&size(10){'''n'''}; specify the set of free links that must exist in the matched process. The optional '''*X''' represents an arbitrary number of extra free links. The form $'''p''' is an abbreviation of $'''p'''[|*'''X'''], i.e., a multiset of atoms and cells with no constraints on the occurrences of free links. A process context must occur within a membrane in a head. Alternatively, it can either - occur in a head and an input position of a guard, or - occur in an output position of a guard. See [[Guards]] for the latter extensions. You can abbreviate >'''p'''('''s'''&size(10){1};, ..., '''s'''&size(10){'''k'''-1};, '''X''', '''s'''&size(10){'''k'''+1};, ..., '''s'''&size(10){'''m'''};), $'''q'''['''X'''] to >'''p'''('''s'''&size(10){1};, ..., '''s'''&size(10){'''k'''-1};, $'''q''', '''s'''&size(10){'''k'''+1};, ..., '''s'''&size(10){'''m'''};). //&math(p(s_1,\ldots,s_{k-1},X, s_{k+1},\ldots,s_m),\$q[X]); to //&math(p(s_1,\ldots,s_{k-1},\$q,s_{k+1},\ldots,s_m));. //Note that the current implementation does not fully // support process contexts with explicit arguments. //* Any Comments? //-the expressions need to be fixed. -- [[nakajima]] &new{2004-02-01 // (Sun) 21:43:32}; //-fixed the expression using math.inc.php -- [[nakajima]] &new{2004-02-02 // (Mon) 21:33:38}; //-fixed math.inc.php. no warnings any more. -- [[nakajima]] &new{2004-02-10 // (Tue) 12:35:06}; //#comment