sfp 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/README.md +60 -20
- data/bin/sfp +23 -3
- data/bin/solver/linux-arm/downward +0 -0
- data/bin/solver/linux-arm/preprocess +0 -0
- data/bin/solver/{linux → linux-x86}/downward +0 -0
- data/bin/solver/{linux → linux-x86}/preprocess +0 -0
- data/lib/sfp.rb +2 -0
- data/lib/sfp/SfpLangLexer.rb +415 -375
- data/lib/sfp/SfpLangParser.rb +921 -915
- data/lib/sfp/executor.rb +207 -0
- data/lib/sfp/planner.rb +27 -5
- data/sfp.gemspec +6 -5
- data/src/SfpLang.g +1 -1
- data/src/build.sh +7 -0
- data/test/{cloud-classes.sfp → cloud-schemas.sfp} +7 -4
- data/test/{v1.1.sfp → future/test1.sfp} +2 -2
- data/test/{cloud1.sfp → nd-cloud1.sfp} +1 -1
- data/test/{cloud2.sfp → nd-cloud2.sfp} +1 -1
- data/test/{cloud3.sfp → nd-cloud3.sfp} +1 -1
- data/test/{service1.sfp → nd-service1.sfp} +1 -2
- data/test/{service3.sfp → nd-service2.sfp} +1 -1
- data/test/run.sh +53 -0
- data/test/{service-classes.sfp → service-schemas.sfp} +6 -6
- data/test/test-module1-scripts.tgz +0 -0
- data/test/test-module1.sfp +20 -0
- data/test/{test.inc → test1.inc} +0 -0
- data/test/test1.sfp +3 -9
- data/test/test2.sfp +15 -12
- data/test/{test2.inc → test3.inc} +0 -0
- data/test/test3.sfp +17 -0
- data/test/{types.sfp → test4.inc} +2 -2
- data/test/{task.sfp → test4.sfp} +1 -1
- metadata +97 -69
- data/test/test.sfp +0 -13
@@ -1,6 +1,6 @@
|
|
1
|
-
include "cloud-
|
1
|
+
include "cloud-schemas.sfp"
|
2
2
|
|
3
|
-
|
3
|
+
schema Service {
|
4
4
|
installed is false
|
5
5
|
running is false
|
6
6
|
on_machine isref Machine
|
@@ -46,7 +46,7 @@ class Service {
|
|
46
46
|
}
|
47
47
|
}
|
48
48
|
|
49
|
-
|
49
|
+
schema LoadBalancer extends Service {
|
50
50
|
webs isset WebService
|
51
51
|
|
52
52
|
procedure start {
|
@@ -63,7 +63,7 @@ class LoadBalancer extends Service {
|
|
63
63
|
}
|
64
64
|
}
|
65
65
|
|
66
|
-
|
66
|
+
schema WebService extends Service {
|
67
67
|
depend_on isref AppService
|
68
68
|
|
69
69
|
procedure redirect ( app isref AppService ) {
|
@@ -99,7 +99,7 @@ class WebService extends Service {
|
|
99
99
|
}
|
100
100
|
}
|
101
101
|
|
102
|
-
|
102
|
+
schema AppService extends Service {
|
103
103
|
depend_on isref DatabaseService
|
104
104
|
|
105
105
|
procedure redirect ( db isref DatabaseService ) {
|
@@ -135,7 +135,7 @@ class AppService extends Service {
|
|
135
135
|
}
|
136
136
|
}
|
137
137
|
|
138
|
-
|
138
|
+
schema DatabaseService extends Service {
|
139
139
|
procedure stop {
|
140
140
|
conditions {
|
141
141
|
this.installed is true
|
Binary file
|
data/test/{test.inc → test1.inc}
RENAMED
File without changes
|
data/test/test1.sfp
CHANGED
data/test/test2.sfp
CHANGED
@@ -1,17 +1,20 @@
|
|
1
|
-
|
1
|
+
schema S {
|
2
|
+
foo is true
|
3
|
+
procedure change {
|
4
|
+
conditions {
|
5
|
+
}
|
6
|
+
effects {
|
7
|
+
this.foo is false
|
8
|
+
}
|
9
|
+
}
|
10
|
+
}
|
2
11
|
|
3
|
-
// generate all possible states with constraint solver
|
4
12
|
initial state {
|
5
|
-
|
6
|
-
|
7
|
-
s3 isa Service
|
13
|
+
a isa S
|
14
|
+
b isa S
|
8
15
|
}
|
16
|
+
|
9
17
|
goal constraint {
|
10
|
-
|
11
|
-
|
12
|
-
s3.running
|
13
|
-
}
|
14
|
-
global constraint {
|
15
|
-
if s1.running then s2.running
|
16
|
-
if s2.running then s3.running
|
18
|
+
a.foo is false
|
19
|
+
b.foo is false
|
17
20
|
}
|
File without changes
|
data/test/test3.sfp
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
include "test3.inc"
|
2
|
+
|
3
|
+
// generate all possible states with constraint solver
|
4
|
+
initial state {
|
5
|
+
s1 isa Service
|
6
|
+
s2 isa Service
|
7
|
+
s3 isa Service
|
8
|
+
}
|
9
|
+
goal constraint {
|
10
|
+
s1.running
|
11
|
+
s2.running
|
12
|
+
s3.running
|
13
|
+
}
|
14
|
+
global constraint {
|
15
|
+
if s1.running then s2.running
|
16
|
+
if s2.running then s3.running
|
17
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
schema Service {
|
2
2
|
running is false
|
3
3
|
procedure start {
|
4
4
|
conditions {
|
@@ -17,7 +17,7 @@ class Service {
|
|
17
17
|
}
|
18
18
|
}
|
19
19
|
}
|
20
|
-
|
20
|
+
schema Client {
|
21
21
|
refer isref Service
|
22
22
|
procedure redirect(s isref Service) {
|
23
23
|
conditions { }
|
data/test/{task.sfp → test4.sfp}
RENAMED
metadata
CHANGED
@@ -1,58 +1,74 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sfp
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Herry
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2013-05-06 00:00:00 +01:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: json
|
16
|
-
|
17
|
-
|
18
|
-
requirements:
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
19
25
|
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 7
|
30
|
+
- 5
|
21
31
|
version: 1.7.5
|
22
32
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
26
35
|
name: antlr3
|
27
|
-
|
28
|
-
|
29
|
-
requirements:
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
30
39
|
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 8
|
44
|
+
- 12
|
32
45
|
version: 1.8.12
|
33
46
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
description: A Ruby gem that provides a Ruby API to SFP language parser and SFP planner.
|
37
|
-
It also provides a planner sript to solve a planning problem written in SFP language.
|
47
|
+
version_requirements: *id002
|
48
|
+
description: A Ruby gem that provides a Ruby API to SFP language parser and SFP planner. It also provides a planner sript to solve a planning problem written in SFP language.
|
38
49
|
email: herry13@gmail.com
|
39
|
-
executables:
|
50
|
+
executables:
|
40
51
|
- sfp
|
41
52
|
extensions: []
|
53
|
+
|
42
54
|
extra_rdoc_files: []
|
43
|
-
|
55
|
+
|
56
|
+
files:
|
44
57
|
- .gitignore
|
45
58
|
- LICENSE
|
46
59
|
- README.md
|
47
60
|
- bin/sfp
|
48
|
-
- bin/solver/linux/downward
|
49
|
-
- bin/solver/linux/preprocess
|
61
|
+
- bin/solver/linux-arm/downward
|
62
|
+
- bin/solver/linux-arm/preprocess
|
63
|
+
- bin/solver/linux-x86/downward
|
64
|
+
- bin/solver/linux-x86/preprocess
|
50
65
|
- bin/solver/macos/downward
|
51
66
|
- bin/solver/macos/preprocess
|
52
67
|
- lib/sfp.rb
|
53
68
|
- lib/sfp/SfpLangLexer.rb
|
54
69
|
- lib/sfp/SfpLangParser.rb
|
55
70
|
- lib/sfp/Sfplib.rb
|
71
|
+
- lib/sfp/executor.rb
|
56
72
|
- lib/sfp/parser.rb
|
57
73
|
- lib/sfp/planner.rb
|
58
74
|
- lib/sfp/sas.rb
|
@@ -62,60 +78,72 @@ files:
|
|
62
78
|
- sfp.gemspec
|
63
79
|
- src/SfpLang.g
|
64
80
|
- src/build.sh
|
65
|
-
- test/cloud-
|
66
|
-
- test/
|
67
|
-
- test/
|
68
|
-
- test/
|
81
|
+
- test/cloud-schemas.sfp
|
82
|
+
- test/future/test1.sfp
|
83
|
+
- test/nd-cloud1.sfp
|
84
|
+
- test/nd-cloud2.sfp
|
85
|
+
- test/nd-cloud3.sfp
|
86
|
+
- test/nd-service1.sfp
|
87
|
+
- test/nd-service2.sfp
|
88
|
+
- test/run.sh
|
69
89
|
- test/s.sfp
|
70
|
-
- test/service-
|
71
|
-
- test/
|
72
|
-
- test/
|
73
|
-
- test/
|
74
|
-
- test/test.inc
|
75
|
-
- test/test.sfp
|
90
|
+
- test/service-schemas.sfp
|
91
|
+
- test/test-module1-scripts.tgz
|
92
|
+
- test/test-module1.sfp
|
93
|
+
- test/test1.inc
|
76
94
|
- test/test1.sfp
|
77
|
-
- test/test2.inc
|
78
95
|
- test/test2.sfp
|
79
|
-
- test/
|
80
|
-
- test/
|
96
|
+
- test/test3.inc
|
97
|
+
- test/test3.sfp
|
98
|
+
- test/test4.inc
|
99
|
+
- test/test4.sfp
|
100
|
+
has_rdoc: true
|
81
101
|
homepage: https://github.com/herry13/sfp-ruby
|
82
102
|
licenses: []
|
103
|
+
|
83
104
|
post_install_message:
|
84
105
|
rdoc_options: []
|
85
|
-
|
106
|
+
|
107
|
+
require_paths:
|
86
108
|
- lib
|
87
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
109
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
segments:
|
114
|
+
- 0
|
115
|
+
version: "0"
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
99
123
|
requirements: []
|
100
|
-
|
101
|
-
|
124
|
+
|
125
|
+
rubyforge_project: sfp
|
126
|
+
rubygems_version: 1.3.6
|
102
127
|
signing_key:
|
103
128
|
specification_version: 3
|
104
129
|
summary: SFP Parser and Planner
|
105
|
-
test_files:
|
106
|
-
- test/cloud-
|
107
|
-
- test/
|
108
|
-
- test/
|
109
|
-
- test/
|
130
|
+
test_files:
|
131
|
+
- test/cloud-schemas.sfp
|
132
|
+
- test/future/test1.sfp
|
133
|
+
- test/nd-cloud1.sfp
|
134
|
+
- test/nd-cloud2.sfp
|
135
|
+
- test/nd-cloud3.sfp
|
136
|
+
- test/nd-service1.sfp
|
137
|
+
- test/nd-service2.sfp
|
138
|
+
- test/run.sh
|
110
139
|
- test/s.sfp
|
111
|
-
- test/service-
|
112
|
-
- test/
|
113
|
-
- test/
|
114
|
-
- test/
|
115
|
-
- test/test.inc
|
116
|
-
- test/test.sfp
|
140
|
+
- test/service-schemas.sfp
|
141
|
+
- test/test-module1-scripts.tgz
|
142
|
+
- test/test-module1.sfp
|
143
|
+
- test/test1.inc
|
117
144
|
- test/test1.sfp
|
118
|
-
- test/test2.inc
|
119
145
|
- test/test2.sfp
|
120
|
-
- test/
|
121
|
-
- test/
|
146
|
+
- test/test3.inc
|
147
|
+
- test/test3.sfp
|
148
|
+
- test/test4.inc
|
149
|
+
- test/test4.sfp
|