From 0a308f58c1863e989b70dfe2f2f4d8e8653cad06 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 22 Mar 2023 20:23:18 -0700 Subject: Update Gentle_introduction_Inpla.md --- Gentle_introduction_Inpla.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'Gentle_introduction_Inpla.md') diff --git a/Gentle_introduction_Inpla.md b/Gentle_introduction_Inpla.md index 0ecb794..c5b1e1a 100644 --- a/Gentle_introduction_Inpla.md +++ b/Gentle_introduction_Inpla.md @@ -360,8 +360,8 @@ We can write it with the abbreviation as well: ![Dup](pic/dup.png) ``` >>> Dup(a1,a2) ~ [Z, S(Z), S(S(Z))]; - (1 interactions, 0.00 sec) - >>> a1 a2 + (10 interactions, 0.00 sec) + >>> a1 a2; [Z,S(Z),S(S(Z))] [Z,S(Z),S(S(Z))] >>> free a1 a2; >>> @@ -475,7 +475,7 @@ In interaction rules, attributes are recognised by using variables with a modifi >>> dup(a1,a2) >< (int i):xs => a1~(i:xs1), a2~(i:xs2), dup(xs1,xs2)~xs; >>> dup(a1,a2) >< [] => a1~[], a2~[]; >>> dup(a,b) ~ [1,2,3]; // This is also written as: a,b << dup([1,2,3]) - (4 interactions, 0.00 sec) + (2 interactions, 0.00 sec) >>> a b; [1,2,3] [1,2,3] >>> free a b; @@ -484,15 +484,10 @@ In interaction rules, attributes are recognised by using variables with a modifi -**We should be careful for operations of two attributes on distinct agents**. For instance, we take the following rule of an `add` agent: +**We should be careful for operations of two attributes on distinct agents**. For instance, we take the following rule of an `add` agent, of course, it works as an addition operation on two attributes: ``` >>> add(result, int b) >< (int a) => result~(a+b); -``` - -Of course, it works as an addition operation on two attributes: - -``` >>> add(r, 3) ~ 5; (1 interactions, 0.00 sec) >>> r; -- cgit v1.2.3