Skip to content

Commit

Permalink
rename rules
Browse files Browse the repository at this point in the history
  • Loading branch information
kyawaway committed Jul 10, 2024
1 parent bbae233 commit 4248128
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions lib/mell.lmn
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
{
module(mell).

mell.copy(M,A1,A2,A3,C1,C2), :-
mell.copy(M,A1,A2,A3,B1,B2,C1,C2), {B1=B2}.

mell.copy(M,A1,A2,A3,C), {$a[A1,A2,A3]} :-
mell.copy(M,A1,A2,A3,B1,B2,C1,C2), {$a[A1,A2,A3]}, {B1=B2}, $a[C1,C2,C].

mell.copy(M,C), :-
mell.copy(M,A1,A2,A3,B1,B2,C1,C2), {cp(A1,A2,A3)}, {B1=B2}, cp(C1,C2,C).

/**
* mell.copy(+Mem, +Cont1, +Cont2, +Cont3, +Cut1, +Cut2, +Free1, +Free2):
*
Expand All @@ -27,11 +18,24 @@ mell.copy(M,A1,A2,A3,C), {$a[A1,A2,A3]} :-
* ==>
* {$p1[M1|*Z1]}, {$p2[M2|*Z2]}, $a[*Z1,*Z2,*Z], $b[M1,C1], $b[M2,C2]
*/

_mell_copy@@
mell.copy(M,A1,A2,A3,B1,B2,C1,C2) :-
'$callback'('mell_copy', M, A1, A2, A3, B1, B2, C1, C2).

_mell_copy_sub1@@
mell.copy(M,A1,A2,A3,C1,C2), :-
mell.copy(M,A1,A2,A3,B1,B2,C1,C2), {B1=B2}.

_mell_copy_sub2@@
mell.copy(M,A1,A2,A3,C), {$a[A1,A2,A3]} :-
mell.copy(M,A1,A2,A3,B1,B2,C1,C2), {$a[A1,A2,A3]}, {B1=B2}, $a[C1,C2,C].

_mell_copy_sub3@@
mell.copy(M,C), :-
mell.copy(M,A1,A2,A3,B1,B2,C1,C2), {cp(A1,A2,A3)}, {B1=B2}, cp(C1,C2,C).


mell.delete(M), :- mell.delete(M, X), {deleted(X)}.

/**
* mell.delete(+Mem, +Weakn)
Expand All @@ -42,8 +46,12 @@ mell.delete(M), :- mell.delete(M, X), {deleted(X)}.
* @param +Weakn 破棄された膜の自由リンクに接続されるプロセス文脈(weakeningにあたる)
* @example mell.delete(M, K),{$p[M|*Z]}, {$k[K]} ==> $k[*Z]
*/
//mell.delete(M, T) :- unary(T) | '$callback'('mell_delete', M, T).

_mell_delete@@
mell.delete(M, T) :- '$callback'('mell_delete', M, T).

_mell_delete_sub@@
mell.delete(M), :- mell.delete(M, X), {deleted(X)}.

}.

0 comments on commit 4248128

Please sign in to comment.