OSDN Git Service

Add: PIONE tutorial of Loop Statement with constraint or sequence. v2.0.2p0091
authorkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Thu, 22 Jan 2015 00:50:55 +0000 (09:50 +0900)
committerkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Thu, 22 Jan 2015 00:50:55 +0000 (09:50 +0900)
new file:   SampleCode/PIONE/Basic11/EvenOddLoop3.pione
new file:   SampleCode/PIONE/Basic11/LoopTouch3.pione
new file:   SampleCode/PIONE/Basic11/LoopTouch4.pione

Add: PIONE tutorial of if Statement for Debug.
new file:   SampleCode/PIONE/Basic7/ForDebug.pione
new file:   SampleCode/PIONE/Basic7/input/1.txt
new file:   SampleCode/PIONE/Basic7/input/2.txt

SampleCode/PIONE/Basic11/EvenOddLoop3.pione [new file with mode: 0644]
SampleCode/PIONE/Basic11/LoopTouch3.pione [new file with mode: 0644]
SampleCode/PIONE/Basic11/LoopTouch4.pione [new file with mode: 0644]
SampleCode/PIONE/Basic7/ForDebug.pione [new file with mode: 0644]
SampleCode/PIONE/Basic7/input/1.txt [new file with mode: 0644]
SampleCode/PIONE/Basic7/input/2.txt [new file with mode: 0644]

diff --git a/SampleCode/PIONE/Basic11/EvenOddLoop3.pione b/SampleCode/PIONE/Basic11/EvenOddLoop3.pione
new file mode 100644 (file)
index 0000000..a0ff8e2
--- /dev/null
@@ -0,0 +1,42 @@
+param $maxval := 456
+param $minval := 123
+param $dval := 37
+
+Rule Main
+       output '*.txt'.all
+Flow
+       rule LoopSystem {val: $minval}
+End
+
+Rule LoopSystem
+       output '*.txt'.all
+       param $val
+       constraint $val <= $maxval
+Flow
+       rule EvenOdd {val: $val}
+       rule LoopSystem {val: (($val * 2) - $minval) + ($dval * (1|2))}
+End
+
+Rule EvenOdd
+       output '*.txt'
+       param $val
+Flow
+       if $val % 2 == 0
+               rule Even {val: $val}
+       else
+               rule Odd {val: $val}
+       end
+End
+
+Rule Even
+       output '*.txt'
+       param $val
+Action
+       echo "{$val} is even." >> Even{$val}.txt;
+End
+
+Rule Odd
+       output '*.txt'
+Action
+       echo "{$val} is odd." >> Odd{$val}.txt;
+End
\ No newline at end of file
diff --git a/SampleCode/PIONE/Basic11/LoopTouch3.pione b/SampleCode/PIONE/Basic11/LoopTouch3.pione
new file mode 100644 (file)
index 0000000..bdedcf3
--- /dev/null
@@ -0,0 +1,24 @@
+param $max := 64
+
+Rule Main
+       output '*.txt'
+Flow
+       rule LoopSystem {val: 0}
+End
+
+Rule LoopSystem
+       output '*.txt'
+       param $val
+       constraint $val <= $max
+Flow
+       rule Test {val: $val}
+       rule LoopSystem {val: ($val * 2) + 1}
+       rule LoopSystem {val: ($val * 2) + 2}
+End
+
+Rule Test
+       output '{$val}.txt'
+       param $val
+Action
+       touch {$O[1]}
+End
\ No newline at end of file
diff --git a/SampleCode/PIONE/Basic11/LoopTouch4.pione b/SampleCode/PIONE/Basic11/LoopTouch4.pione
new file mode 100644 (file)
index 0000000..69926a2
--- /dev/null
@@ -0,0 +1,23 @@
+param $max := 64
+
+Rule Main
+       output '*.txt'
+Flow
+       rule LoopSystem {val: 0}
+End
+
+Rule LoopSystem
+       output '*.txt'
+       param $val
+       constraint $val <= $max
+Flow
+       rule Test {val: $val}
+       rule LoopSystem {val: ($val * 2) + (1|2)}
+End
+
+Rule Test
+       output '{$val}.txt'
+       param $val
+Action
+       touch {$O[1]}
+End
\ No newline at end of file
diff --git a/SampleCode/PIONE/Basic7/ForDebug.pione b/SampleCode/PIONE/Basic7/ForDebug.pione
new file mode 100644 (file)
index 0000000..33475a7
--- /dev/null
@@ -0,0 +1,43 @@
+$LogFlag := false
+$LogFile := '{$I[1][1]}.log'
+
+Rule Main
+       input '*.txt'
+       output '{$I[1][1]}.out'
+       if $LogFlag
+               output $LogFile
+       end
+Flow
+       rule Sub1
+End
+
+Rule Sub1
+       input '*.txt'
+       output '{$I[1][1]}.out'
+       if $LogFlag
+               output $LogFile
+       end
+Flow
+       rule Sub2
+End
+
+Rule Sub2
+       input '*.txt'
+       output '{$I[1][1]}.out'
+       if $LogFlag
+               output $LogFile
+       end
+Flow
+       rule Sub3
+End
+
+Rule Sub3
+       input '*.txt'
+       output '{$I[1][1]}.out'
+       output $LogFile
+Action
+       touch {$O[1]}
+       if [ {$LogFlag} ] ; then
+               wc {$I[1]} > {$O[2]}
+       fi
+End
\ No newline at end of file
diff --git a/SampleCode/PIONE/Basic7/input/1.txt b/SampleCode/PIONE/Basic7/input/1.txt
new file mode 100644 (file)
index 0000000..33a0a15
--- /dev/null
@@ -0,0 +1,5 @@
+1234
+56789
+0qwe
+rt
+y
diff --git a/SampleCode/PIONE/Basic7/input/2.txt b/SampleCode/PIONE/Basic7/input/2.txt
new file mode 100644 (file)
index 0000000..99de5ac
--- /dev/null
@@ -0,0 +1,3 @@
+!!!!!!!!!!!!!!!!!
+DDDDDDDDDDDDDDDDD
+!!!!!!!!!!!!!!!!!