pione 0.5.0.alpha.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +8 -8
  2. data/History.txt +2 -1
  3. data/example/DeferredChoiceWithPage/DeferredChoiceWithPage.pione +2 -5
  4. data/example/DeferredChoiceWithPage/{DefferredChoiceWithPage.pnml → DeferredChoiceWithPage.pnml} +0 -0
  5. data/example/DeferredChoiceWithPage/pione-package.json +2 -1
  6. data/example/FeatureExample/FeatureExample.pione +1 -1
  7. data/example/FeatureExample/pione-package.json +2 -2
  8. data/example/Fib/Fib.pione +9 -54
  9. data/example/Fib/FibN.pione +49 -0
  10. data/example/Interaction/Interaction.pione +6 -8
  11. data/example/Interaction/pione-package.json +6 -5
  12. data/example/LoopByTouch/LoopByTouch.pione +1 -3
  13. data/example/LoopByTouch/LoopByTouch.pnml +23 -6
  14. data/example/MakePair/scenario/case1/pione-scenario.json +28 -28
  15. data/example/MakePair/scenario/case2/pione-scenario.json +10 -10
  16. data/example/MakePair/scenario/case3/pione-scenario.json +26 -26
  17. data/example/OddSelector/OddSelector.pione +0 -1
  18. data/example/OddSelector/pione-package.json +2 -2
  19. data/example/OddSelector/scenario/pione-scenario.json +9 -9
  20. data/example/PegasusWMS/Merge/PegasusWMSMerge.pione +0 -1
  21. data/example/PegasusWMS/Merge/PegasusWMSMerge.pnml +2 -2
  22. data/example/PegasusWMS/Pipeline/PegasusWMSPipeline.pione +0 -1
  23. data/example/PegasusWMS/Split/PegasusWMSSplit.pione +0 -1
  24. data/example/ScoreAggregation/pione-package.json +3 -3
  25. data/example/ScoreAggregation/scenario/case1/pione-scenario.json +19 -19
  26. data/example/SelectRuleByParam/SelectRuleByParam.pione +5 -15
  27. data/example/SelectRuleByParam/pione-package.json +4 -0
  28. data/example/SequentialParameter/SequentialParameter.pione +0 -1
  29. data/example/SerialProcessing/A.pione +0 -1
  30. data/example/SerialProcessing/B.pione +0 -1
  31. data/example/SerialProcessing/SerialProcessing.pione +0 -1
  32. data/example/SerialProcessing/pione-package.json +2 -2
  33. data/example/SieveOfEratosthenes/CreateUndeterminedNumbers.pione +11 -0
  34. data/example/SingleParticlesWithRef/Create3dinfo.pione +36 -0
  35. data/example/SingleParticlesWithRef/Create3dinfo.pnml +5 -5
  36. data/example/SingleParticlesWithRef/Package.pione +3 -0
  37. data/example/SingleParticlesWithRef/SingleParticlesWithRef.pione +8 -91
  38. data/example/SingleParticlesWithRef/SingleParticlesWithRef.pnml +6 -6
  39. data/example/SingleParticlesWithRef/misc/{SingleParticlesWithRef.Display2.pione → SingleParticlesWithRef.Display2.pione.bak} +0 -0
  40. data/example/SingleParticlesWithRef/misc/{SingleParticlesWithRefFull.pione → SingleParticlesWithRefFull.pione.bak} +0 -0
  41. data/example/SingleParticlesWithRef/pione-package.json +20 -0
  42. data/example/WorkflowPatterns/07_StructuredSynchronizingMerge/StructuredSynchronizingMerge.pione +20 -46
  43. data/example/WorkflowPatterns/07_StructuredSynchronizingMerge/pione-package.json +19 -0
  44. data/example/WorkflowPatterns/12_MultipleInstancesWithoutSynchronization/MultipleInstancesWithoutSynchronization.pione +0 -1
  45. data/example/WorkflowPatterns/13_MultipleInstancesWithDesignTimeKnowledge/MultipleInstancesWithDesignTimeKnowledge.pione +0 -1
  46. data/example/WorkflowPatterns/14_MultipleInstancesWithRunTimeKnowledge/MultipleInstancesWithRunTimeKnowledge.pione +0 -1
  47. data/example/WorkflowPatterns/33_GeneralizedANDJoin/GeneralizedANDJoin.pione +0 -1
  48. data/example/WorkflowPatterns/38_GeneralSynchronizingMerge/GeneralSynchronizingMerge.pione +28 -68
  49. data/example/WorkflowPatterns/41_ThreadMerge/A.pione +24 -0
  50. data/example/WorkflowPatterns/41_ThreadMerge/A1.pione +14 -0
  51. data/example/WorkflowPatterns/41_ThreadMerge/ThreadMerge.pione +8 -31
  52. data/example/WorkflowPatterns/41_ThreadMerge/pione-package.json +21 -0
  53. data/example/WorkflowPatterns/42_ThreadSplit/ThreadSplit.pione +7 -7
  54. data/example/WorkflowPatterns/42_ThreadSplit/pione-package.json +19 -0
  55. data/lib/pione/command/pione-package-build.rb +2 -1
  56. data/lib/pione/lang/expr-parser.rb +1 -1
  57. data/lib/pione/lang/expr-transformer.rb +2 -0
  58. data/lib/pione/lang/type.rb +2 -2
  59. data/lib/pione/lang/variable.rb +8 -0
  60. data/lib/pione/pnml/compiler.rb +42 -23
  61. data/lib/pione/pnml/declaration-extractor.rb +16 -6
  62. data/lib/pione/pnml/pione-model.rb +18 -6
  63. data/lib/pione/pnml/ticket-instantiation.rb +2 -2
  64. data/lib/pione/version.rb +1 -1
  65. metadata +16 -7
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTUzMjJhZmQwY2EyNmQzODZlZThhYTQ3YzA2NmQzYTgxMjM5ZTg4ZQ==
4
+ ZjExZDBmYjYyYjY2OTY0MjVlZWZhOTUwMzI0YTQ0MTM1ZTY5YTMxOQ==
5
5
  data.tar.gz: !binary |-
6
- ZWE3MzQ1NTFlOGZkNmNjYzA1ZTliMzFmMmYyZTE5MThjMjYyMWRkNQ==
6
+ NDg5ODVlZWFlMjA3MGNkYmQ2NmIxZmIxZTM1MDY0Yzg2NWMyYTA2OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzNiNzQxMmYwMjllMjE4MzQ1Nzk3YzFiNWM3NzVhMWMzM2Q5YmFkMDA3Njgx
10
- MDQyZmRmNzk0M2E5YTdmMjJkOWUyOGI4ZGE1YmI1OTkwMDkxMjFjYTY0YjI1
11
- MTY2ZTAzY2Q4MzQyZjU4NTA2NTI2YWRmNDBkZWVkMjAxYzFiMjY=
9
+ ZDhhMmNhZDcyYTU3YWM1MzA4NGQ5OGNiOGIyYzI4ZGNmMTNkNTIzYjBiOWVm
10
+ ZDM2ZGQyMTU3ZWJkYjVmMjY1Zjc4OTFkMzEyNGZhMGYyZDZiZGEyZGRlOGQ0
11
+ ZDFhMjU3YTBmNjljZDY3ZGY0Njg0Nzk1MWU3MGExZGMwM2U3ODM=
12
12
  data.tar.gz: !binary |-
13
- ODFlMGIxZTM4Zjc4M2Q0YjU5ZmNmNDNhOTNkOGRlNTYyMDM0ZWNmZTk2ZGZj
14
- YjFhNWEzZWE0MGMwZmNhZjVlNTI4NmNhNTM3N2IxZWE2ZThjZGVhMTg2M2Iz
15
- OGVlYzJjMGNiYmQwMjk2NmQyNmMwZjBhZTFkYWFkNTdhNDk4MWY=
13
+ Y2ZmMjdhMDMyZWMxODg1MjJmNTBiMzJmNGU3ZDMyZWUyMjAwNjNmZTgyMTQ3
14
+ MWQyNGRlNmUxZDM1ZWQxNjE0MzUyYjBjMTlhOTM4MjQ0OTcyN2NhNzgyZThi
15
+ MDA3YzczODU5YmNmOGEwNjVhNGI4YzAzZmI4YjY2ZjFjNDU2NzQ=
@@ -1,10 +1,11 @@
1
1
  # History
2
2
 
3
- ## 0.5.0
3
+ ## 0.5.0(2015/1/21)
4
4
 
5
5
  * Improved PNML compiler.
6
6
  * Fixed many bugs.
7
7
  * More readable error messages.
8
+ * Work with Ruby 1.9.3, 2.0, and 2.1.
8
9
 
9
10
  ## 0.4.2(2014/9/1)
10
11
 
@@ -1,6 +1,4 @@
1
- .@ PackageName :: "DefferredChoiceWithPage"
2
-
3
- Rule Main
1
+ Rule DeferredChoiceWithPage
4
2
  output 'result.txt'
5
3
  Flow
6
4
  rule UserSelect
@@ -14,7 +12,7 @@ Rule UserSelect
14
12
  Action
15
13
  # start interactive operation
16
14
  pione-interactive browser -o rule.txt --public ./etc
17
-
15
+
18
16
  # generate an output
19
17
  RULE=`cat rule.txt`
20
18
  case "$RULE" in
@@ -44,4 +42,3 @@ Rule C
44
42
  Action
45
43
  echo 'You selected rule C' > {$O[1]}
46
44
  End
47
-
@@ -4,7 +4,8 @@
4
4
 
5
5
  ],
6
6
  "Documents": [
7
- "DeferredChoiceWithPage.pione"
7
+ "DeferredChoiceWithPage.pione",
8
+ "Package.pione"
8
9
  ],
9
10
  "Scenarios": [
10
11
 
@@ -1,4 +1,3 @@
1
-
2
1
  Rule FeatureExample
3
2
  output 'message.txt'
4
3
  Flow
@@ -7,6 +6,7 @@ End
7
6
 
8
7
  Rule FeaturedAction
9
8
  output 'message.txt'
9
+ feature +X
10
10
  Action
11
11
  echo "I can take the task." > {$O[1]}
12
12
  End
@@ -4,8 +4,8 @@
4
4
 
5
5
  ],
6
6
  "Documents": [
7
- "Package.pione",
8
- "FeatureExample.pione"
7
+ "FeatureExample.pione",
8
+ "Package.pione"
9
9
  ],
10
10
  "Scenarios": [
11
11
 
@@ -1,65 +1,20 @@
1
- .@ PackageName :: "Fib"
2
- .@ Editor :: "keita.yamaguchi@gmail.com"
3
- .@ "Fib.pione calculates the value of Fibonacci number."
4
-
5
- param $NUM := 3
6
-
7
- Rule Main
1
+ Rule Fib
8
2
  output 'result.txt'
9
3
  Flow
10
- rule Fib {N: $NUM}
11
4
  rule Result
12
- End
13
-
14
- Rule Fib0
15
- .@ "the value of fib(0) is 0"
16
- output 'fib0.txt'
17
- Action
18
- echo -n '0' > fib0.txt
19
- End
20
-
21
- Rule Fib1
22
- .@ "the value of fib(1) is 1"
23
- output 'fib1.txt'
24
- Action
25
- echo -n '1' > fib1.txt
26
- End
27
-
28
- Rule Fib
29
- .@ "fib(n) is fib(0), fib(1), or fib(n-1) + fib(n-2)"
30
- output 'fib{$N}.txt'
31
- param $N
32
- Flow
33
- case $N
34
- when 0
35
- rule Fib0
36
- when 1
37
- rule Fib1
38
- else
39
- $P1 := $N - 2
40
- $P2 := $N - 1
41
- rule Fib {N: $P1}
42
- rule Fib {N: $P2}
43
- rule Calc {N: $N, P1: $P1, P2: $P2}
44
- end
45
- End
46
-
47
- Rule Calc
48
- .@ "calculate the value of fib(n-1) + fib(n-2)"
49
- input 'fib{$P1}.txt'
50
- input 'fib{$P2}.txt'
51
- output 'fib{$N}.txt'
52
- param $N
53
- param $P1
54
- param $P2
55
- Action
56
- echo "`cat {$I[1]}` + `cat {$I[2]}`" | bc > {$O[1]}
5
+ rule __Fib_FibN_1__
57
6
  End
58
7
 
59
8
  Rule Result
60
- .@ "make the result"
61
9
  input 'fib*.txt'
62
10
  output 'result.txt'
63
11
  Action
64
12
  cp {$I[1]} {$O[1]}
65
13
  End
14
+
15
+ Rule __Fib_FibN_1__
16
+ output 'fib{$N}.txt'
17
+ param $N := $NUM
18
+ Flow
19
+ rule FibN
20
+ End
@@ -0,0 +1,49 @@
1
+ Rule FibN
2
+ output 'fib{$N}.txt'
3
+ param $N := 3
4
+ Flow
5
+ rule Calc
6
+ case $N
7
+ when 0
8
+ rule Fib0
9
+ when 1
10
+ rule Fib1
11
+ else
12
+ rule FibN
13
+ rule FibN
14
+ end
15
+
16
+ End
17
+
18
+ Rule FibN
19
+ output 'fib{$P1}.txt'
20
+ param $N := $N-1
21
+ End
22
+
23
+ Rule FibN
24
+ output 'fib{$P2}.txt'
25
+ param $N := $N-2
26
+ End
27
+
28
+ Rule Calc
29
+ input 'fib{$P1}.txt'
30
+ input 'fib{$P2}.txt'
31
+ output 'fib{$N}.txt'
32
+ param $P2 := $N-2
33
+ param $N := $N
34
+ param $P1 := $N-1
35
+ Action
36
+ echo "`cat {$I[1]}` + `cat {$I[2]}`" | bc > {$O[1]}
37
+ End
38
+
39
+ Rule Fib0
40
+ output 'fib0.txt'
41
+ Action
42
+ echo -n '0' > fib0.txt
43
+ End
44
+
45
+ Rule Fib1
46
+ output 'fib1.txt'
47
+ Action
48
+ echo -n '1' > fib1.txt
49
+ End
@@ -1,12 +1,10 @@
1
- .@ PackageName :: "Interaction"
2
-
3
- Rule Main
1
+ Rule Interaction
4
2
  output 'output*.txt'.all
5
3
  Flow
6
- rule Interaction
4
+ rule InteractiveAction
7
5
  End
8
6
 
9
- Rule Interaction
7
+ Rule InteractiveAction
10
8
  output 'output*.txt'.all
11
9
  Action
12
10
  # build public directory for pione-interactive
@@ -14,14 +12,14 @@ Action
14
12
  cp bin/* public
15
13
  cp etc/* public
16
14
  cp etc/.hidden-file.txt public
17
-
15
+
18
16
  # set environment variables for CGI
19
17
  export ENV_EXAMPLE1=a
20
18
  export ENV_EXAMPLE2=b
21
19
  export ENV_EXAMPLE3=c
22
-
20
+
23
21
  # start interactive operation
24
22
  pione-interactive browser --public public
25
-
23
+
26
24
  cp public/* .
27
25
  End
@@ -4,7 +4,8 @@
4
4
 
5
5
  ],
6
6
  "Documents": [
7
- "Interaction.pione"
7
+ "Interaction.pione",
8
+ "Package.pione"
8
9
  ],
9
10
  "Scenarios": [
10
11
 
@@ -13,12 +14,12 @@
13
14
  "bin/show-environment.cgi"
14
15
  ],
15
16
  "Etcs": [
17
+ "etc/.hidden-file.txt",
18
+ "etc/cgi.html",
16
19
  "etc/create-files.html",
17
- "etc/list-files.html",
20
+ "etc/delete-files.html",
18
21
  "etc/get-files.html",
19
22
  "etc/index.html",
20
- "etc/delete-files.html",
21
- "etc/cgi.html",
22
- "etc/.hidden-file.txt"
23
+ "etc/list-files.html"
23
24
  ]
24
25
  }
@@ -1,5 +1,6 @@
1
1
  Rule LoopByTouch
2
2
  output '1' or '2' or '3'
3
+ param $N := 1
3
4
  Flow
4
5
  rule Init
5
6
  case $N
@@ -18,7 +19,6 @@ Rule Init
18
19
  End
19
20
 
20
21
  Rule __LoopByTouch_TripletLoop_1__
21
- input 3
22
22
  input '1'
23
23
  output '3'
24
24
  Flow
@@ -26,7 +26,6 @@ Flow
26
26
  End
27
27
 
28
28
  Rule __LoopByTouch_SingleLoop_2__
29
- input 1
30
29
  input '1'
31
30
  output '1'
32
31
  Flow
@@ -34,7 +33,6 @@ Flow
34
33
  End
35
34
 
36
35
  Rule __LoopByTouch_PairLoop_3__
37
- input 2
38
36
  input '1'
39
37
  output '2'
40
38
  Flow
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <!--PLEASE DO NOT EDIT THIS FILE
3
- Created with Workflow PetriNet Designer Version 3.2.0 (woped.org)-->
3
+ Created with Workflow PetriNet Designer Version 1.0 (woped.org)-->
4
4
  <pnml>
5
5
  <net type="http://www.informatik.hu-berlin.de/top/pntd/ptNetb" id="noID">
6
6
  <place id="p7">
@@ -211,6 +211,23 @@ Created with Workflow PetriNet Designer Version 3.2.0 (woped.org)-->
211
211
  <orientation>1</orientation>
212
212
  </toolspecific>
213
213
  </transition>
214
+ <transition id="t12">
215
+ <name>
216
+ <text>param $N := 1</text>
217
+ <graphics>
218
+ <offset x="140" y="70"/>
219
+ </graphics>
220
+ </name>
221
+ <graphics>
222
+ <position x="140" y="30"/>
223
+ <dimension x="40" y="40"/>
224
+ </graphics>
225
+ <toolspecific tool="WoPeD" version="1.0">
226
+ <time>0</time>
227
+ <timeUnit>1</timeUnit>
228
+ <orientation>1</orientation>
229
+ </toolspecific>
230
+ </transition>
214
231
  <transition id="t4">
215
232
  <name>
216
233
  <text>extern SingleLoop</text>
@@ -511,7 +528,7 @@ Created with Workflow PetriNet Designer Version 3.2.0 (woped.org)-->
511
528
  <displayProbabilityPosition x="500.0" y="0.0"/>
512
529
  </toolspecific>
513
530
  </arc>
514
- <arc id="a18" source="t10" target="p10">
531
+ <arc id="a7" source="p5" target="t4">
515
532
  <inscription>
516
533
  <text>1</text>
517
534
  </inscription>
@@ -522,7 +539,7 @@ Created with Workflow PetriNet Designer Version 3.2.0 (woped.org)-->
522
539
  <displayProbabilityPosition x="500.0" y="0.0"/>
523
540
  </toolspecific>
524
541
  </arc>
525
- <arc id="a7" source="p5" target="t4">
542
+ <arc id="a18" source="t10" target="p10">
526
543
  <inscription>
527
544
  <text>1</text>
528
545
  </inscription>
@@ -533,7 +550,7 @@ Created with Workflow PetriNet Designer Version 3.2.0 (woped.org)-->
533
550
  <displayProbabilityPosition x="500.0" y="0.0"/>
534
551
  </toolspecific>
535
552
  </arc>
536
- <arc id="a19" source="p10" target="t11">
553
+ <arc id="a8" source="t4" target="p6">
537
554
  <inscription>
538
555
  <text>1</text>
539
556
  </inscription>
@@ -544,7 +561,7 @@ Created with Workflow PetriNet Designer Version 3.2.0 (woped.org)-->
544
561
  <displayProbabilityPosition x="500.0" y="0.0"/>
545
562
  </toolspecific>
546
563
  </arc>
547
- <arc id="a8" source="t4" target="p6">
564
+ <arc id="a19" source="p10" target="t11">
548
565
  <inscription>
549
566
  <text>1</text>
550
567
  </inscription>
@@ -557,7 +574,7 @@ Created with Workflow PetriNet Designer Version 3.2.0 (woped.org)-->
557
574
  </arc>
558
575
  <toolspecific tool="WoPeD" version="1.0">
559
576
  <bounds>
560
- <position x="2" y="22"/>
577
+ <position x="2" y="25"/>
561
578
  <dimension x="1905" y="784"/>
562
579
  </bounds>
563
580
  <scale>100</scale>
@@ -2,46 +2,46 @@
2
2
  "ScenarioName": "case1",
3
3
  "ParamSet": null,
4
4
  "Inputs": [
5
+ "input/1.i",
5
6
  "input/2.i",
6
- "input/5.i",
7
7
  "input/3.i",
8
- "input/1.i",
9
- "input/4.i"
8
+ "input/4.i",
9
+ "input/5.i"
10
10
  ],
11
11
  "Outputs": [
12
- "output/perm-5-1.pair",
13
- "output/perm-3-1.pair",
14
- "output/perm-2-5.pair",
15
- "output/perm-4-5.pair",
16
- "output/comb-2-5.pair",
17
12
  "output/comb-1-2.pair",
13
+ "output/comb-1-3.pair",
14
+ "output/comb-1-4.pair",
15
+ "output/comb-1-5.pair",
16
+ "output/comb-2-3.pair",
17
+ "output/comb-2-4.pair",
18
+ "output/comb-2-5.pair",
19
+ "output/comb-3-4.pair",
20
+ "output/comb-3-5.pair",
21
+ "output/comb-4-5.pair",
22
+ "output/perm-1-2.pair",
18
23
  "output/perm-1-3.pair",
24
+ "output/perm-1-4.pair",
25
+ "output/perm-1-5.pair",
19
26
  "output/perm-2-1.pair",
20
- "output/perm-4-1.pair",
21
- "output/perm-4-3.pair",
27
+ "output/perm-2-3.pair",
22
28
  "output/perm-2-4.pair",
23
- "output/comb-4-5.pair",
24
- "output/succ-3-4.pair",
25
- "output/perm-1-5.pair",
26
- "output/comb-1-3.pair",
29
+ "output/perm-2-5.pair",
30
+ "output/perm-3-1.pair",
27
31
  "output/perm-3-2.pair",
28
- "output/perm-5-4.pair",
29
- "output/perm-4-2.pair",
30
32
  "output/perm-3-4.pair",
31
- "output/comb-3-4.pair",
32
- "output/comb-2-4.pair",
33
- "output/comb-1-4.pair",
33
+ "output/perm-3-5.pair",
34
+ "output/perm-4-1.pair",
35
+ "output/perm-4-2.pair",
36
+ "output/perm-4-3.pair",
37
+ "output/perm-4-5.pair",
38
+ "output/perm-5-1.pair",
39
+ "output/perm-5-2.pair",
34
40
  "output/perm-5-3.pair",
35
- "output/succ-4-5.pair",
41
+ "output/perm-5-4.pair",
36
42
  "output/succ-1-2.pair",
37
- "output/perm-2-3.pair",
38
- "output/perm-5-2.pair",
39
43
  "output/succ-2-3.pair",
40
- "output/perm-3-5.pair",
41
- "output/perm-1-4.pair",
42
- "output/comb-1-5.pair",
43
- "output/comb-2-3.pair",
44
- "output/comb-3-5.pair",
45
- "output/perm-1-2.pair"
44
+ "output/succ-3-4.pair",
45
+ "output/succ-4-5.pair"
46
46
  ]
47
47
  }