text2model 0.1.0__py3-none-any.whl
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.
- text2model/__init__.py +1 -0
- text2model/grammar.mzn +277 -0
- text2model/knowledge_graphs/CSPLib_12.ttl +41 -0
- text2model/knowledge_graphs/CSPLib_14.ttl +51 -0
- text2model/knowledge_graphs/CSPLib_2.ttl +59 -0
- text2model/knowledge_graphs/CSPLib_22.ttl +62 -0
- text2model/knowledge_graphs/CSPLib_28.ttl +28 -0
- text2model/knowledge_graphs/CSPLib_30.ttl +72 -0
- text2model/knowledge_graphs/CSPLib_34.ttl +52 -0
- text2model/knowledge_graphs/CSPLib_39.ttl +51 -0
- text2model/knowledge_graphs/CSPLib_54.ttl +50 -0
- text2model/knowledge_graphs/CSPLib_6.ttl +36 -0
- text2model/knowledge_graphs/CSPLib_8.ttl +53 -0
- text2model/knowledge_graphs/LPWP_128.ttl +79 -0
- text2model/knowledge_graphs/LPWP_232.ttl +95 -0
- text2model/knowledge_graphs/LPWP_53.ttl +58 -0
- text2model/knowledge_graphs/LPWP_66.ttl +52 -0
- text2model/knowledge_graphs/LPWP_85.ttl +95 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_1.ttl +34 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_18.ttl +59 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_2.ttl +43 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_28.ttl +42 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_31.ttl +44 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_4.ttl +48 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_5.ttl +40 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_6.ttl +61 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_8.ttl +54 -0
- text2model/knowledge_graphs/combinatorial_problem_1.ttl +48 -0
- text2model/knowledge_graphs/combinatorial_problem_31.ttl +43 -0
- text2model/knowledge_graphs/combinatorial_problem_32.ttl +39 -0
- text2model/knowledge_graphs/combinatorial_problem_7.ttl +52 -0
- text2model/knowledge_graphs/complexor_AircraftAssignment.ttl +73 -0
- text2model/knowledge_graphs/complexor_AircraftLanding.ttl +53 -0
- text2model/knowledge_graphs/complexor_CFLP.ttl +43 -0
- text2model/knowledge_graphs/complexor_CapacitatedWarehouseLocation.ttl +59 -0
- text2model/knowledge_graphs/complexor_CarSelection.ttl +30 -0
- text2model/knowledge_graphs/complexor_TSP.ttl +52 -0
- text2model/knowledge_graphs/complexor_VRPTW.ttl +67 -0
- text2model/knowledge_graphs/nlp4lp_1.ttl +56 -0
- text2model/knowledge_graphs/nlp4lp_10.ttl +46 -0
- text2model/knowledge_graphs/nlp4lp_11.ttl +57 -0
- text2model/knowledge_graphs/nlp4lp_12.ttl +48 -0
- text2model/knowledge_graphs/nlp4lp_13.ttl +48 -0
- text2model/knowledge_graphs/nlp4lp_14.ttl +82 -0
- text2model/knowledge_graphs/nlp4lp_15.ttl +60 -0
- text2model/knowledge_graphs/nlp4lp_16.ttl +64 -0
- text2model/knowledge_graphs/nlp4lp_17.ttl +72 -0
- text2model/knowledge_graphs/nlp4lp_18.ttl +64 -0
- text2model/knowledge_graphs/nlp4lp_19.ttl +98 -0
- text2model/knowledge_graphs/nlp4lp_2.ttl +103 -0
- text2model/knowledge_graphs/nlp4lp_20.ttl +129 -0
- text2model/knowledge_graphs/nlp4lp_21.ttl +65 -0
- text2model/knowledge_graphs/nlp4lp_22.ttl +72 -0
- text2model/knowledge_graphs/nlp4lp_23.ttl +63 -0
- text2model/knowledge_graphs/nlp4lp_24.ttl +99 -0
- text2model/knowledge_graphs/nlp4lp_25.ttl +77 -0
- text2model/knowledge_graphs/nlp4lp_27.ttl +75 -0
- text2model/knowledge_graphs/nlp4lp_28.ttl +50 -0
- text2model/knowledge_graphs/nlp4lp_29.ttl +63 -0
- text2model/knowledge_graphs/nlp4lp_3.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_30.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_31.ttl +35 -0
- text2model/knowledge_graphs/nlp4lp_32.ttl +33 -0
- text2model/knowledge_graphs/nlp4lp_33.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_34.ttl +67 -0
- text2model/knowledge_graphs/nlp4lp_35.ttl +75 -0
- text2model/knowledge_graphs/nlp4lp_36.ttl +56 -0
- text2model/knowledge_graphs/nlp4lp_37.ttl +52 -0
- text2model/knowledge_graphs/nlp4lp_38.ttl +55 -0
- text2model/knowledge_graphs/nlp4lp_39.ttl +58 -0
- text2model/knowledge_graphs/nlp4lp_4.ttl +64 -0
- text2model/knowledge_graphs/nlp4lp_40.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_41.ttl +62 -0
- text2model/knowledge_graphs/nlp4lp_42.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_43.ttl +98 -0
- text2model/knowledge_graphs/nlp4lp_44.ttl +41 -0
- text2model/knowledge_graphs/nlp4lp_45.ttl +56 -0
- text2model/knowledge_graphs/nlp4lp_46.ttl +35 -0
- text2model/knowledge_graphs/nlp4lp_47.ttl +68 -0
- text2model/knowledge_graphs/nlp4lp_48.ttl +74 -0
- text2model/knowledge_graphs/nlp4lp_49.ttl +66 -0
- text2model/knowledge_graphs/nlp4lp_5.ttl +69 -0
- text2model/knowledge_graphs/nlp4lp_50.ttl +51 -0
- text2model/knowledge_graphs/nlp4lp_51.ttl +53 -0
- text2model/knowledge_graphs/nlp4lp_52.ttl +51 -0
- text2model/knowledge_graphs/nlp4lp_53.ttl +55 -0
- text2model/knowledge_graphs/nlp4lp_54.ttl +74 -0
- text2model/knowledge_graphs/nlp4lp_55.ttl +50 -0
- text2model/knowledge_graphs/nlp4lp_56.ttl +67 -0
- text2model/knowledge_graphs/nlp4lp_57.ttl +59 -0
- text2model/knowledge_graphs/nlp4lp_58.ttl +65 -0
- text2model/knowledge_graphs/nlp4lp_6.ttl +63 -0
- text2model/knowledge_graphs/nlp4lp_60.ttl +36 -0
- text2model/knowledge_graphs/nlp4lp_61.ttl +83 -0
- text2model/knowledge_graphs/nlp4lp_62.ttl +44 -0
- text2model/knowledge_graphs/nlp4lp_63.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_64.ttl +41 -0
- text2model/knowledge_graphs/nlp4lp_65.ttl +78 -0
- text2model/knowledge_graphs/nlp4lp_66.ttl +51 -0
- text2model/knowledge_graphs/nlp4lp_67.ttl +40 -0
- text2model/knowledge_graphs/nlp4lp_7.ttl +53 -0
- text2model/knowledge_graphs/nlp4lp_8.ttl +51 -0
- text2model/knowledge_graphs/nlp4lp_9.ttl +58 -0
- text2model/knowledge_graphs/non_linear_problem_10.ttl +57 -0
- text2model/knowledge_graphs/non_linear_problem_15.ttl +55 -0
- text2model/knowledge_graphs/non_linear_problem_23.ttl +42 -0
- text2model/knowledge_graphs/non_linear_problem_9.ttl +61 -0
- text2model/knowledge_graphs/puzzles_problem_1.ttl +64 -0
- text2model/knowledge_graphs/puzzles_problem_11.ttl +65 -0
- text2model/knowledge_graphs/puzzles_problem_12.ttl +79 -0
- text2model/knowledge_graphs/puzzles_problem_13.ttl +50 -0
- text2model/knowledge_graphs/puzzles_problem_31.ttl +62 -0
- text2model/main.py +771 -0
- text2model/prompts/assembler_prompt.txt +104 -0
- text2model/prompts/code_stitching_prompt.txt +49 -0
- text2model/prompts/code_validation_prompt.txt +36 -0
- text2model/prompts/constraint_generation_prompt.txt +35 -0
- text2model/prompts/cot_prompt.txt +45 -0
- text2model/prompts/global_constraint_prompts/all_different_prompt.txt +67 -0
- text2model/prompts/global_constraint_prompts/count_prompt.txt +75 -0
- text2model/prompts/global_constraint_prompts/cumulative_prompt.txt +88 -0
- text2model/prompts/global_constraint_prompts/global_cardinality_prompt.txt +76 -0
- text2model/prompts/global_constraint_prompts/increasing_prompt.txt +81 -0
- text2model/prompts/global_constraint_prompts/lex_less_prompt.txt +68 -0
- text2model/prompts/grammar_validation_prompt.txt +18 -0
- text2model/prompts/kg_code_generation_prompt.txt +20 -0
- text2model/prompts/kg_generation_prompt.txt +40 -0
- text2model/prompts/objective_generation_prompt.txt +34 -0
- text2model/prompts/parameter_and_variable_generation_prompt.txt +35 -0
- text2model/utils.py +350 -0
- text2model-0.1.0.dist-info/METADATA +221 -0
- text2model-0.1.0.dist-info/RECORD +135 -0
- text2model-0.1.0.dist-info/WHEEL +5 -0
- text2model-0.1.0.dist-info/entry_points.txt +2 -0
- text2model-0.1.0.dist-info/top_level.txt +1 -0
text2model/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""text2model: LLM Modeling Copilots for Text-to-Model Translation."""
|
text2model/grammar.mzn
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
% A MiniZinc model
|
|
2
|
+
<model> ::= [ <item> ";" ... ]
|
|
3
|
+
|
|
4
|
+
% Items
|
|
5
|
+
<item> ::= <include-item>
|
|
6
|
+
| <var-decl-item>
|
|
7
|
+
| <enum-item>
|
|
8
|
+
| <type-inst-syn-item>
|
|
9
|
+
| <assign-item>
|
|
10
|
+
| <constraint-item>
|
|
11
|
+
| <solve-item>
|
|
12
|
+
| <output-item>
|
|
13
|
+
| <predicate-item>
|
|
14
|
+
| <test-item>
|
|
15
|
+
| <function-item>
|
|
16
|
+
| <annotation-item>
|
|
17
|
+
|
|
18
|
+
<ti-expr-and-id> ::= <ti-expr> ":" <ident>
|
|
19
|
+
|
|
20
|
+
% Include items
|
|
21
|
+
<include-item> ::= "include" <string-literal>
|
|
22
|
+
|
|
23
|
+
% Variable declaration items
|
|
24
|
+
<var-decl-item> ::= <ti-expr-and-id> <annotations> [ "=" <expr> ]
|
|
25
|
+
| "any" ":" <ident> <annotations> [ "=" <expr> ]
|
|
26
|
+
|
|
27
|
+
% Enum items
|
|
28
|
+
<enum-item> ::= "enum" <ident> <annotations> [ "=" <enum-cases-list> ]
|
|
29
|
+
|
|
30
|
+
<enum-cases-list> ::= <enum-cases>
|
|
31
|
+
| <enum-cases-list> "++" <enum-cases>
|
|
32
|
+
|
|
33
|
+
<enum-cases> ::= "{" <ident> "," ... "}"
|
|
34
|
+
| "_" "(" <expr> ")"
|
|
35
|
+
| <ident> "(" <ident> ")"
|
|
36
|
+
| "anon_enum" "(" <expr> ")"
|
|
37
|
+
|
|
38
|
+
% Type-inst synonym items
|
|
39
|
+
<type-inst-syn-item> ::= "type" <ident> <annotations> "=" <ti-expr>
|
|
40
|
+
|
|
41
|
+
% Assign items
|
|
42
|
+
<assign-item> ::= <ident> "=" <expr>
|
|
43
|
+
|
|
44
|
+
% Constraint items
|
|
45
|
+
<constraint-item> ::= "constraint" [ <string-annotation> ] <expr>
|
|
46
|
+
|
|
47
|
+
% Solve item
|
|
48
|
+
<solve-item> ::= "solve" <annotations> "satisfy"
|
|
49
|
+
| "solve" <annotations> "minimize" <expr>
|
|
50
|
+
| "solve" <annotations> "maximize" <expr>
|
|
51
|
+
|
|
52
|
+
% Output items
|
|
53
|
+
<output-item> ::= "output" [ <string-annotation> ] <expr>
|
|
54
|
+
|
|
55
|
+
% Annotation items
|
|
56
|
+
<annotation-item> ::= "annotation" <ident> <params> [ "=" <expr> ]
|
|
57
|
+
|
|
58
|
+
% Predicate, test and function items
|
|
59
|
+
<predicate-item> ::= "predicate" <operation-item-tail>
|
|
60
|
+
|
|
61
|
+
<test-item> ::= "test" <operation-item-tail>
|
|
62
|
+
|
|
63
|
+
<function-item> ::= "function" <ti-expr> ":" <operation-item-tail>
|
|
64
|
+
|
|
65
|
+
<operation-item-tail> ::= <ident> <params> <annotations> [ "=" <expr> ]
|
|
66
|
+
|
|
67
|
+
<params> ::= [ ( <ti-expr-and-id> "," ... ) ]
|
|
68
|
+
|
|
69
|
+
% Type-inst expressions
|
|
70
|
+
<ti-expr> ::= <base-ti-expr>
|
|
71
|
+
| <array-ti-expr>
|
|
72
|
+
|
|
73
|
+
<base-ti-expr> ::= <var-par> <opt-ti> <set-ti> <base-ti-expr-tail> ["++" <base-ti-expr>]
|
|
74
|
+
| "any" <ti-variable-expr-tail>
|
|
75
|
+
|
|
76
|
+
<var-par> ::= "var" | "par" | ε
|
|
77
|
+
|
|
78
|
+
<opt-ti> ::= "opt" | ε
|
|
79
|
+
|
|
80
|
+
<set-ti> ::= "set" "of" | ε
|
|
81
|
+
|
|
82
|
+
<base-type> ::= "bool"
|
|
83
|
+
| "int"
|
|
84
|
+
| "float"
|
|
85
|
+
| "string"
|
|
86
|
+
|
|
87
|
+
<base-ti-expr-tail> ::= <ident>
|
|
88
|
+
| <base-type>
|
|
89
|
+
| <ti-variable-expr-tail>
|
|
90
|
+
| <tuple-ti-expr-tail>
|
|
91
|
+
| <record-ti-expr-tail>
|
|
92
|
+
| "ann"
|
|
93
|
+
| <expr>
|
|
94
|
+
|
|
95
|
+
% Type-inst variables
|
|
96
|
+
<ti-variable-expr-tail> ::= $[A-Za-z$][A-Za-z0-9_]*
|
|
97
|
+
|
|
98
|
+
% Array type-inst expressions
|
|
99
|
+
<array-ti-expr> ::= "array" [ <ti-expr> "," ... ] "of" <base-ti-expr>
|
|
100
|
+
| "list" "of" <base-ti-expr>
|
|
101
|
+
|
|
102
|
+
% Tuple type-inst expressions
|
|
103
|
+
<tuple-ti-expr-tail> ::= "tuple" ( <ti-expr> "," ... )
|
|
104
|
+
|
|
105
|
+
% Record type-inst expressions
|
|
106
|
+
<record-ti-expr-tail> ::= "record" ( <ti-expr-and-id> "," ... )
|
|
107
|
+
|
|
108
|
+
% Expressions
|
|
109
|
+
<expr> ::= <expr-atom> <expr-binop-tail>
|
|
110
|
+
|
|
111
|
+
<expr-atom> ::= <expr-atom-head> <expr-atom-tail> <annotations>
|
|
112
|
+
|
|
113
|
+
<expr-binop-tail> ::= [ <bin-op> <expr> ]
|
|
114
|
+
|
|
115
|
+
<expr-atom-head> ::= <builtin-un-op> <expr-atom>
|
|
116
|
+
| "(" <expr> ")"
|
|
117
|
+
| <ident-or-quoted-op>
|
|
118
|
+
| "_"
|
|
119
|
+
| <bool-literal>
|
|
120
|
+
| <int-literal>
|
|
121
|
+
| <float-literal>
|
|
122
|
+
| <string-literal>
|
|
123
|
+
| <set-literal>
|
|
124
|
+
| <set-comp>
|
|
125
|
+
| <array-literal>
|
|
126
|
+
| <array-literal-2d>
|
|
127
|
+
| <indexed-array-literal>
|
|
128
|
+
| <indexed-array-literal-2d>
|
|
129
|
+
| <tuple-literal>
|
|
130
|
+
| <record-literal>
|
|
131
|
+
| <array-comp>
|
|
132
|
+
| <indexed-array-comp>
|
|
133
|
+
| <ann-literal>
|
|
134
|
+
| <if-then-else-expr>
|
|
135
|
+
| <let-expr>
|
|
136
|
+
| <call-expr>
|
|
137
|
+
| <gen-call-expr>
|
|
138
|
+
|
|
139
|
+
<expr-atom-tail> ::= ε
|
|
140
|
+
| <array-access-tail> <expr-atom-tail>
|
|
141
|
+
|
|
142
|
+
% Numeric expressions
|
|
143
|
+
<num-expr> ::= <num-expr-atom> <num-expr-binop-tail>
|
|
144
|
+
|
|
145
|
+
<num-expr-atom> ::= <num-expr-atom-head> <expr-atom-tail> <annotations>
|
|
146
|
+
|
|
147
|
+
<num-expr-binop-tail> ::= [ <num-bin-op> <num-expr> ]
|
|
148
|
+
|
|
149
|
+
<num-expr-atom-head> ::= <builtin-num-un-op> <num-expr-atom>
|
|
150
|
+
| "(" <num-expr> ")"
|
|
151
|
+
| <ident-or-quoted-op>
|
|
152
|
+
| <int-literal>
|
|
153
|
+
| <float-literal>
|
|
154
|
+
| <if-then-else-expr>
|
|
155
|
+
| <let-expr>
|
|
156
|
+
| <call-expr>
|
|
157
|
+
| <gen-call-expr>
|
|
158
|
+
|
|
159
|
+
% Built-in operators
|
|
160
|
+
<builtin-op> ::= <builtin-bin-op> | <builtin-un-op>
|
|
161
|
+
|
|
162
|
+
<bin-op> ::= <builtin-bin-op> | ‘<ident>‘
|
|
163
|
+
|
|
164
|
+
<builtin-bin-op> ::= "<->" | "->" | "<-" | "\/" | "xor" | "/\"
|
|
165
|
+
| "<" | ">" | "<=" | ">=" | "==" | "=" | "!="
|
|
166
|
+
| "~=" | "~!="
|
|
167
|
+
| "in" | "subset" | "superset" | "union" | "diff" | "symdiff"
|
|
168
|
+
| ".." | "intersect" | "++" | "default" | <builtin-num-bin-op>
|
|
169
|
+
|
|
170
|
+
<builtin-un-op> ::= "not" | <builtin-num-un-op>
|
|
171
|
+
|
|
172
|
+
% Built-in numeric operators
|
|
173
|
+
<num-bin-op> ::= <builtin-num-bin-op> | ‘<ident>‘
|
|
174
|
+
|
|
175
|
+
<builtin-num-bin-op> ::= "+" | "-" | "*" | "/" | "div" | "mod" | "^"
|
|
176
|
+
| "~+" | "~-" | "~*" | "~/" | "~div"
|
|
177
|
+
|
|
178
|
+
<builtin-num-un-op> ::= "+" | "-"
|
|
179
|
+
|
|
180
|
+
% Boolean literals
|
|
181
|
+
<bool-literal> ::= "false" | "true"
|
|
182
|
+
|
|
183
|
+
% Integer literals
|
|
184
|
+
<int-literal> ::= [0-9]+
|
|
185
|
+
| 0x[0-9A-Fa-f]+
|
|
186
|
+
| 0o[0-7]+
|
|
187
|
+
|
|
188
|
+
% Float literals
|
|
189
|
+
<float-literal> ::= [0-9]+"."[0-9]+
|
|
190
|
+
| [0-9]+"."[0-9]+[Ee][-+]?[0-9]+
|
|
191
|
+
| [0-9]+[Ee][-+]?[0-9]+
|
|
192
|
+
| 0[xX]([0-9a-fA-F]*"."[0-9a-fA-F]+|[0-9a-fA-F]+".")([pP][+-]?[0-9]+)
|
|
193
|
+
| (0[xX][0-9a-fA-F]+[pP][+-]?[0-9]+)
|
|
194
|
+
|
|
195
|
+
% String literals
|
|
196
|
+
<string-contents> ::= ([^"\n\] | \[0-7][0-7?][0-7]? | \x[0-9a-fA-F][0-9a-fA-F]? | \n | \t | \" | \\)*
|
|
197
|
+
|
|
198
|
+
<string-literal> ::= """ <string-contents> """
|
|
199
|
+
| """ <string-contents> "\(" <string-interpolate-tail>
|
|
200
|
+
|
|
201
|
+
<string-interpolate-tail> ::= <expr> ")"<string-contents>"""
|
|
202
|
+
| <expr> ")"<string-contents>"\(" <string-interpolate-tail>
|
|
203
|
+
|
|
204
|
+
% Set literals
|
|
205
|
+
<set-literal> ::= "{" [ <expr> "," ... ] "}"
|
|
206
|
+
|
|
207
|
+
% Set comprehensions
|
|
208
|
+
<set-comp> ::= "{" <expr> "|" <comp-tail> "}"
|
|
209
|
+
|
|
210
|
+
<comp-tail> ::= <generator> [ "where" <expr> ] "," ...
|
|
211
|
+
|
|
212
|
+
<generator> ::= ( <ident> | "_" ) "," ... "in" <expr>
|
|
213
|
+
|
|
214
|
+
% Array literals
|
|
215
|
+
<array-literal> ::= "[" [ <expr> "," ... ] "]"
|
|
216
|
+
|
|
217
|
+
% 2D Array literals
|
|
218
|
+
<array-literal-2d> ::= "[|" [ [ <expr> "," ... ] "|" ... ] "|]"
|
|
219
|
+
|
|
220
|
+
% Indexed 2D Array literals
|
|
221
|
+
<indexed-array-literal-2d> ::= "[|" [ <expr> ":" ... ] [ [ <expr> ":" ] <expr> "," ... ] "|]"
|
|
222
|
+
|
|
223
|
+
% Indexed array literals
|
|
224
|
+
<indexed-array-literal> ::= "[" [ ( <index-tuple> ":" <expr> ) "," ... ] "]"
|
|
225
|
+
| "[" [ <index-tuple> ":" <expr> "," <expr> "," ... ] "]"
|
|
226
|
+
|
|
227
|
+
<index-tuple> ::= <expr>
|
|
228
|
+
| "(" [ <expr> "," ... ] ")"
|
|
229
|
+
|
|
230
|
+
% Tuple literals
|
|
231
|
+
<tuple-literal> ::= "(" <expr> "," [ <expr> "," ... ] ")"
|
|
232
|
+
|
|
233
|
+
% Record literals
|
|
234
|
+
<record-literal> ::= "(" <ident> ":" <expr> "," [ <ident> ":" <expr> "," ... ] ")"
|
|
235
|
+
|
|
236
|
+
% Array comprehensions
|
|
237
|
+
<array-comp> ::= "[" <expr> "|" <comp-tail> "]"
|
|
238
|
+
|
|
239
|
+
% Indexed array comprehensions
|
|
240
|
+
<indexed-array-comp> ::= "[" <index-tuple> ":" <expr> "|" <comp-tail> "]"
|
|
241
|
+
|
|
242
|
+
% Array access
|
|
243
|
+
<array-access-tail> ::= "[" <expr> "," ... "]"
|
|
244
|
+
|
|
245
|
+
% Annotation literals
|
|
246
|
+
<ann-literal> ::= <ident> [ "(" <expr> "," ... ")" ]
|
|
247
|
+
|
|
248
|
+
% If-then-else expressions
|
|
249
|
+
<if-then-else-expr> ::= "if" <expr> "then" <expr> [ "elseif" <expr> "then" <expr> ]* [ "else" <expr> ] "endif"
|
|
250
|
+
|
|
251
|
+
% Call expressions
|
|
252
|
+
<call-expr> ::= <ident-or-quoted-op> [ "(" <expr> "," ... ")" ]
|
|
253
|
+
|
|
254
|
+
% Let expressions
|
|
255
|
+
<let-expr> ::= "let" "{" <let-item> ";" ... "}" "in" <expr>
|
|
256
|
+
|
|
257
|
+
<let-item> ::= <var-decl-item>
|
|
258
|
+
| <constraint-item>
|
|
259
|
+
|
|
260
|
+
% Generator call expressions
|
|
261
|
+
<gen-call-expr> ::= <ident-or-quoted-op> "(" <comp-tail> ")" "(" <expr> ")"
|
|
262
|
+
|
|
263
|
+
% Miscellaneous
|
|
264
|
+
|
|
265
|
+
% Identifiers
|
|
266
|
+
<ident> ::= _?[A-Za-z][A-Za-z0-9_]* | ’[^’\xa\xd\x0]+’
|
|
267
|
+
|
|
268
|
+
% Identifiers and quoted operators
|
|
269
|
+
<ident-or-quoted-op> ::= <ident>
|
|
270
|
+
| ’<builtin-op>’
|
|
271
|
+
|
|
272
|
+
% Annotations
|
|
273
|
+
<annotations> ::= [ "::" <annotation> ]*
|
|
274
|
+
|
|
275
|
+
<annotation> ::= <expr-atom-head> <expr-atom-tail>
|
|
276
|
+
|
|
277
|
+
<string-annotation> ::= "::" <string-literal>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
2
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
3
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
4
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
5
|
+
@prefix : <http://example.org/> .
|
|
6
|
+
|
|
7
|
+
:rows a rdf:Property ;
|
|
8
|
+
rdfs:domain :Nonogram ;
|
|
9
|
+
rdfs:range xsd:integer ;
|
|
10
|
+
rdfs:comment "Number of rows in the grid" .
|
|
11
|
+
|
|
12
|
+
:row_rule_len a rdf:Property ;
|
|
13
|
+
rdfs:domain :Nonogram ;
|
|
14
|
+
rdfs:range xsd:integer ;
|
|
15
|
+
rdfs:comment "Length of row_rules for each row (number of constraints)" .
|
|
16
|
+
|
|
17
|
+
:row_rules a rdf:Property ;
|
|
18
|
+
rdfs:domain :Nonogram ;
|
|
19
|
+
rdfs:range :Array2D ;
|
|
20
|
+
rdfs:comment "Constraints for each row in the grid indicating the sequence of shaded blocks" .
|
|
21
|
+
|
|
22
|
+
:cols a rdf:Property ;
|
|
23
|
+
rdfs:domain :Nonogram ;
|
|
24
|
+
rdfs:range xsd:integer ;
|
|
25
|
+
rdfs:comment "Number of columns in the grid" .
|
|
26
|
+
|
|
27
|
+
:col_rule_len a rdf:Property ;
|
|
28
|
+
rdfs:domain :Nonogram ;
|
|
29
|
+
rdfs:range xsd:integer ;
|
|
30
|
+
rdfs:comment "Length of col_rules for each column (number of constraints)" .
|
|
31
|
+
|
|
32
|
+
:col_rules a rdf:Property ;
|
|
33
|
+
rdfs:domain :Nonogram ;
|
|
34
|
+
rdfs:range :Array2D ;
|
|
35
|
+
rdfs:comment "Constraints for each column in the grid indicating the sequence of shaded blocks" .
|
|
36
|
+
|
|
37
|
+
:Array2D a rdfs:Class ;
|
|
38
|
+
rdfs:comment "2D array of integers" .
|
|
39
|
+
|
|
40
|
+
:Nonogram a rdfs:Class ;
|
|
41
|
+
rdfs:comment "Nonogram puzzle" .
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
2
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
3
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
4
|
+
@prefix sb: <http://www.example.org/solitairebattleships#> .
|
|
5
|
+
|
|
6
|
+
sb:height a rdf:Property ;
|
|
7
|
+
rdfs:domain sb:SolitaireBattleships ;
|
|
8
|
+
rdfs:range xsd:integer .
|
|
9
|
+
|
|
10
|
+
sb:width a rdf:Property ;
|
|
11
|
+
rdfs:domain sb:SolitaireBattleships ;
|
|
12
|
+
rdfs:range xsd:integer .
|
|
13
|
+
|
|
14
|
+
sb:maxship a rdf:Property ;
|
|
15
|
+
rdfs:domain sb:SolitaireBattleships ;
|
|
16
|
+
rdfs:range xsd:integer .
|
|
17
|
+
|
|
18
|
+
sb:hint a rdf:Property ;
|
|
19
|
+
rdfs:domain sb:SolitaireBattleships ;
|
|
20
|
+
rdfs:range xsd:array .
|
|
21
|
+
|
|
22
|
+
sb:rowsum a rdf:Property ;
|
|
23
|
+
rdfs:domain sb:SolitaireBattleships ;
|
|
24
|
+
rdfs:range xsd:array .
|
|
25
|
+
|
|
26
|
+
sb:colsum a rdf:Property ;
|
|
27
|
+
rdfs:domain sb:SolitaireBattleships ;
|
|
28
|
+
rdfs:range xsd:array .
|
|
29
|
+
|
|
30
|
+
sb:ship a rdf:Property ;
|
|
31
|
+
rdfs:domain sb:SolitaireBattleships ;
|
|
32
|
+
rdfs:range xsd:array .
|
|
33
|
+
|
|
34
|
+
sb:SolitaireBattleships a rdfs:Class ;
|
|
35
|
+
rdfs:comment "A class representing the Solitaire Battleships problem" .
|
|
36
|
+
|
|
37
|
+
sb:Board a rdfs:Class ;
|
|
38
|
+
rdfs:subClassOf sb:SolitaireBattleships ;
|
|
39
|
+
rdfs:comment "A class representing the board in the Solitaire Battleships problem" .
|
|
40
|
+
|
|
41
|
+
sb:Ship a rdfs:Class ;
|
|
42
|
+
rdfs:subClassOf sb:SolitaireBattleships ;
|
|
43
|
+
rdfs:comment "A class representing the ships in the Solitaire Battleships problem" .
|
|
44
|
+
|
|
45
|
+
sb:Constraint a rdfs:Class ;
|
|
46
|
+
rdfs:subClassOf sb:SolitaireBattleships ;
|
|
47
|
+
rdfs:comment "A class representing the constraints in the Solitaire Battleships problem" .
|
|
48
|
+
|
|
49
|
+
sb:Objective a rdfs:Class ;
|
|
50
|
+
rdfs:subClassOf sb:SolitaireBattleships ;
|
|
51
|
+
rdfs:comment "A class representing the objective in the Solitaire Battleships problem" .
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
2
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
3
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
4
|
+
@prefix opt: <http://www.example.org/optimization#> .
|
|
5
|
+
|
|
6
|
+
opt:slotsPerTemplate a rdf:Property ;
|
|
7
|
+
rdfs:label "Number of slots per template" ;
|
|
8
|
+
rdfs:domain opt:PrintingProblem ;
|
|
9
|
+
rdfs:range xsd:integer .
|
|
10
|
+
|
|
11
|
+
opt:numberOfTemplates a rdf:Property ;
|
|
12
|
+
rdfs:label "Number of templates to produce" ;
|
|
13
|
+
rdfs:domain opt:PrintingProblem ;
|
|
14
|
+
rdfs:range xsd:integer .
|
|
15
|
+
|
|
16
|
+
opt:numberOfVariations a rdf:Property ;
|
|
17
|
+
rdfs:label "Number of variations of carton designs" ;
|
|
18
|
+
rdfs:domain opt:PrintingProblem ;
|
|
19
|
+
rdfs:range xsd:integer .
|
|
20
|
+
|
|
21
|
+
opt:demandArray a rdf:Property ;
|
|
22
|
+
rdfs:label "Array indicating how many of each variation must be printed" ;
|
|
23
|
+
rdfs:domain opt:PrintingProblem ;
|
|
24
|
+
rdfs:range xsd:integer .
|
|
25
|
+
|
|
26
|
+
opt:PrintingProblem a rdfs:Class ;
|
|
27
|
+
rdfs:label "Color Printing Optimization Problem" ;
|
|
28
|
+
rdfs:subClassOf opt:OptimizationProblem .
|
|
29
|
+
|
|
30
|
+
opt:OptimizationProblem a rdfs:Class ;
|
|
31
|
+
rdfs:label "Optimization Problem" .
|
|
32
|
+
|
|
33
|
+
opt:hasObjective a rdf:Property ;
|
|
34
|
+
rdfs:label "has objective" ;
|
|
35
|
+
rdfs:domain opt:OptimizationProblem ;
|
|
36
|
+
rdfs:range opt:Objective .
|
|
37
|
+
|
|
38
|
+
opt:Objective a rdfs:Class ;
|
|
39
|
+
rdfs:label "Objective" .
|
|
40
|
+
|
|
41
|
+
opt:minimizeSurplus a opt:Objective ;
|
|
42
|
+
rdfs:label "Minimize surplus" ;
|
|
43
|
+
rdfs:comment "The configurations of the slots for the templates that leads to the minimum amount of surplus when all the demands are met" .
|
|
44
|
+
|
|
45
|
+
opt:hasConstraint a rdf:Property ;
|
|
46
|
+
rdfs:label "has constraint" ;
|
|
47
|
+
rdfs:domain opt:OptimizationProblem ;
|
|
48
|
+
rdfs:range opt:Constraint .
|
|
49
|
+
|
|
50
|
+
opt:Constraint a rdfs:Class ;
|
|
51
|
+
rdfs:label "Constraint" .
|
|
52
|
+
|
|
53
|
+
opt:meetDemand a opt:Constraint ;
|
|
54
|
+
rdfs:label "Meet demand" ;
|
|
55
|
+
rdfs:comment "A minimum demand of each design variation that must be manufactured" .
|
|
56
|
+
|
|
57
|
+
opt:lexicographicOrder a opt:Constraint ;
|
|
58
|
+
rdfs:label "Lexicographic order" ;
|
|
59
|
+
rdfs:comment "The templates are organized in lexicographic order" .
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
2
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
3
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
4
|
+
@prefix opt: <http://www.example.org/optimization#> .
|
|
5
|
+
|
|
6
|
+
opt:BusDriverScheduling
|
|
7
|
+
rdf:type opt:OptimizationProblem ;
|
|
8
|
+
opt:hasParameter opt:num_work, opt:num_shifts, opt:min_num_shifts, opt:shifts ;
|
|
9
|
+
opt:hasVariable opt:shift_selection ;
|
|
10
|
+
opt:hasConstraint opt:work_coverage, opt:min_shift_requirement ;
|
|
11
|
+
opt:hasObjective opt:minimize_shifts .
|
|
12
|
+
|
|
13
|
+
opt:num_work
|
|
14
|
+
rdf:type opt:Parameter ;
|
|
15
|
+
rdfs:label "num_work" ;
|
|
16
|
+
rdfs:comment "Number of pieces of work to cover" ;
|
|
17
|
+
rdfs:range xsd:integer .
|
|
18
|
+
|
|
19
|
+
opt:num_shifts
|
|
20
|
+
rdf:type opt:Parameter ;
|
|
21
|
+
rdfs:label "num_shifts" ;
|
|
22
|
+
rdfs:comment "Number of possible shifts available" ;
|
|
23
|
+
rdfs:range xsd:integer .
|
|
24
|
+
|
|
25
|
+
opt:min_num_shifts
|
|
26
|
+
rdf:type opt:Parameter ;
|
|
27
|
+
rdfs:label "min_num_shifts" ;
|
|
28
|
+
rdfs:comment "Minimum number of shifts required for a partition" ;
|
|
29
|
+
rdfs:range xsd:integer .
|
|
30
|
+
|
|
31
|
+
opt:shifts
|
|
32
|
+
rdf:type opt:Parameter ;
|
|
33
|
+
rdfs:label "shifts" ;
|
|
34
|
+
rdfs:comment "Details of shifts each shift covers" ;
|
|
35
|
+
rdfs:range rdf:Seq .
|
|
36
|
+
|
|
37
|
+
opt:shift_selection
|
|
38
|
+
rdf:type opt:Variable ;
|
|
39
|
+
rdfs:label "shift_selection" ;
|
|
40
|
+
rdfs:comment "Selection of shifts to cover the work" ;
|
|
41
|
+
rdfs:range rdf:Seq .
|
|
42
|
+
|
|
43
|
+
opt:work_coverage
|
|
44
|
+
rdf:type opt:Constraint ;
|
|
45
|
+
rdfs:label "work_coverage" ;
|
|
46
|
+
rdfs:comment "Each piece of work must be covered exactly once" .
|
|
47
|
+
|
|
48
|
+
opt:min_shift_requirement
|
|
49
|
+
rdf:type opt:Constraint ;
|
|
50
|
+
rdfs:label "min_shift_requirement" ;
|
|
51
|
+
rdfs:comment "The number of shifts used must be at least the minimum number of shifts required" .
|
|
52
|
+
|
|
53
|
+
opt:minimize_shifts
|
|
54
|
+
rdf:type opt:Objective ;
|
|
55
|
+
rdfs:label "minimize_shifts" ;
|
|
56
|
+
rdfs:comment "Minimize the number of shifts used" ;
|
|
57
|
+
opt:optimizationType opt:Minimization .
|
|
58
|
+
|
|
59
|
+
opt:Minimization
|
|
60
|
+
rdf:type opt:OptimizationType ;
|
|
61
|
+
rdfs:label "Minimization" ;
|
|
62
|
+
rdfs:comment "The goal is to minimize the objective function" .
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Sorry, as a text-based AI model, I'm unable to generate visual content such as graphs or diagrams. However, I can provide you with a textual representation of the knowledge graph.
|
|
2
|
+
|
|
3
|
+
1. Parameters:
|
|
4
|
+
- v: Number of distinct objects (Type: Scalar)
|
|
5
|
+
- k: Number of distinct objects in each block (Type: Scalar)
|
|
6
|
+
- lambda: Scalar product between any pair of distinct rows (Type: Scalar)
|
|
7
|
+
|
|
8
|
+
2. Variables:
|
|
9
|
+
- Objects: The distinct objects that need to be arranged (Type: Set)
|
|
10
|
+
- Blocks: The groups in which objects are arranged (Type: Set)
|
|
11
|
+
|
|
12
|
+
3. Constraints:
|
|
13
|
+
- Each block must contain exactly k distinct objects.
|
|
14
|
+
- Each object must appear in exactly lambda blocks.
|
|
15
|
+
- Each pair of objects must appear together in exactly lambda blocks.
|
|
16
|
+
|
|
17
|
+
4. Objective:
|
|
18
|
+
- The goal is to arrange the objects into blocks according to the constraints. This is a satisfaction problem, so there is no explicit objective function to minimize or maximize.
|
|
19
|
+
|
|
20
|
+
5. Turtle (TTL) Representation:
|
|
21
|
+
- :v rdf:type owl:DatatypeProperty .
|
|
22
|
+
- :k rdf:type owl:DatatypeProperty .
|
|
23
|
+
- :lambda rdf:type owl:DatatypeProperty .
|
|
24
|
+
- :Objects rdf:type owl:Class .
|
|
25
|
+
- :Blocks rdf:type owl:Class .
|
|
26
|
+
- :hasObject rdf:type owl:ObjectProperty ; rdfs:domain :Blocks ; rdfs:range :Objects .
|
|
27
|
+
- :appearsIn rdf:type owl:ObjectProperty ; rdfs:domain :Objects ; rdfs:range :Blocks .
|
|
28
|
+
- :appearsTogether rdf:type owl:ObjectProperty ; rdfs:domain :Objects ; rdfs:range :Objects .
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
@prefix bacp: <http://www.semanticweb.org/ontologies/bacp#> .
|
|
2
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
3
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
4
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
5
|
+
|
|
6
|
+
bacp:Problem a rdfs:Class ;
|
|
7
|
+
rdfs:label "Balanced Academic Curriculum Problem" .
|
|
8
|
+
|
|
9
|
+
bacp:hasParameter a rdf:Property ;
|
|
10
|
+
rdfs:domain bacp:Problem ;
|
|
11
|
+
rdfs:range bacp:Parameter .
|
|
12
|
+
|
|
13
|
+
bacp:Parameter a rdfs:Class ;
|
|
14
|
+
rdfs:label "Parameter" ;
|
|
15
|
+
rdfs:subClassOf [ a rdfs:Class ;
|
|
16
|
+
rdfs:label "Scalar" ;
|
|
17
|
+
rdfs:subClassOf [ a rdfs:Class ;
|
|
18
|
+
rdfs:label "Integer" ] ] .
|
|
19
|
+
|
|
20
|
+
bacp:n_courses a bacp:Parameter ;
|
|
21
|
+
rdfs:label "Number of courses in the academic curriculum" ;
|
|
22
|
+
rdfs:comment "Example: n_courses=6" .
|
|
23
|
+
|
|
24
|
+
bacp:n_periods a bacp:Parameter ;
|
|
25
|
+
rdfs:label "Number of academic periods available for scheduling" ;
|
|
26
|
+
rdfs:comment "Example: n_periods=3" .
|
|
27
|
+
|
|
28
|
+
bacp:load_per_period_lb a bacp:Parameter ;
|
|
29
|
+
rdfs:label "Lower bound for academic load per period" ;
|
|
30
|
+
rdfs:comment "Example: load_per_period_lb=10" .
|
|
31
|
+
|
|
32
|
+
bacp:load_per_period_ub a bacp:Parameter ;
|
|
33
|
+
rdfs:label "Upper bound for academic load per period" ;
|
|
34
|
+
rdfs:comment "Example: load_per_period_ub=30" .
|
|
35
|
+
|
|
36
|
+
bacp:courses_per_period_lb a bacp:Parameter ;
|
|
37
|
+
rdfs:label "Lower bound for number of courses per period" ;
|
|
38
|
+
rdfs:comment "Example: courses_per_period_lb=2" .
|
|
39
|
+
|
|
40
|
+
bacp:courses_per_period_ub a bacp:Parameter ;
|
|
41
|
+
rdfs:label "Upper bound for number of courses per period" ;
|
|
42
|
+
rdfs:comment "Example: courses_per_period_ub=4" .
|
|
43
|
+
|
|
44
|
+
bacp:course_load a bacp:Parameter ;
|
|
45
|
+
rdfs:label "Array representing the academic load of each course" ;
|
|
46
|
+
rdfs:comment "Example: course_load=[5, 10, 15, 10, 5, 10]" ;
|
|
47
|
+
rdfs:subClassOf [ a rdfs:Class ;
|
|
48
|
+
rdfs:label "Array" ;
|
|
49
|
+
rdfs:subClassOf [ a rdfs:Class ;
|
|
50
|
+
rdfs:label "Integer" ] ] .
|
|
51
|
+
|
|
52
|
+
bacp:hasVariable a rdf:Property ;
|
|
53
|
+
rdfs:domain bacp:Problem ;
|
|
54
|
+
rdfs:range bacp:Variable .
|
|
55
|
+
|
|
56
|
+
bacp:Variable a rdfs:Class ;
|
|
57
|
+
rdfs:label "Variable" .
|
|
58
|
+
|
|
59
|
+
bacp:hasConstraint a rdf:Property ;
|
|
60
|
+
rdfs:domain bacp:Problem ;
|
|
61
|
+
rdfs:range bacp:Constraint .
|
|
62
|
+
|
|
63
|
+
bacp:Constraint a rdfs:Class ;
|
|
64
|
+
rdfs:label "Constraint" .
|
|
65
|
+
|
|
66
|
+
bacp:hasObjective a rdf:Property ;
|
|
67
|
+
rdfs:domain bacp:Problem ;
|
|
68
|
+
rdfs:range bacp:Objective .
|
|
69
|
+
|
|
70
|
+
bacp:Objective a rdfs:Class ;
|
|
71
|
+
rdfs:label "Objective" ;
|
|
72
|
+
rdfs:comment "Minimizes the maximum courseload across all periods" .
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
2
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
3
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
4
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
5
|
+
@prefix wlp: <http://www.example.org/warehouse_location_problem#> .
|
|
6
|
+
|
|
7
|
+
wlp:n_suppliers a owl:DatatypeProperty ;
|
|
8
|
+
rdfs:domain wlp:WarehouseLocationProblem ;
|
|
9
|
+
rdfs:range xsd:integer ;
|
|
10
|
+
rdfs:comment "Number of warehouse candidates" .
|
|
11
|
+
|
|
12
|
+
wlp:n_stores a owl:DatatypeProperty ;
|
|
13
|
+
rdfs:domain wlp:WarehouseLocationProblem ;
|
|
14
|
+
rdfs:range xsd:integer ;
|
|
15
|
+
rdfs:comment "Number of stores" .
|
|
16
|
+
|
|
17
|
+
wlp:building_cost a owl:DatatypeProperty ;
|
|
18
|
+
rdfs:domain wlp:WarehouseLocationProblem ;
|
|
19
|
+
rdfs:range xsd:integer ;
|
|
20
|
+
rdfs:comment "Cost of opening a warehouse" .
|
|
21
|
+
|
|
22
|
+
wlp:capacity a owl:DatatypeProperty ;
|
|
23
|
+
rdfs:domain wlp:WarehouseLocationProblem ;
|
|
24
|
+
rdfs:range xsd:integer ;
|
|
25
|
+
rdfs:comment "Array containing the capacity of each warehouse" .
|
|
26
|
+
|
|
27
|
+
wlp:cost_matrix a owl:DatatypeProperty ;
|
|
28
|
+
rdfs:domain wlp:WarehouseLocationProblem ;
|
|
29
|
+
rdfs:range xsd:integer ;
|
|
30
|
+
rdfs:comment "Cost matrix where each element represents the cost of a store being supplied by a warehouse" .
|
|
31
|
+
|
|
32
|
+
wlp:WarehouseLocationProblem a owl:Class ;
|
|
33
|
+
rdfs:subClassOf owl:Thing ;
|
|
34
|
+
rdfs:comment "Warehouse Location Problem (WLP) is an optimization problem where a company aims to open warehouses at candidate locations to supply its stores. Each warehouse has a maintenance cost and specific capacity. Each store must be supplied by exactly one warehouse, with supply costs varying per warehouse. The goal is to minimize the sum of maintenance and supply costs by determining which warehouses to open and assigning them to supply stores." .
|
|
35
|
+
|
|
36
|
+
wlp:hasObjective a owl:ObjectProperty ;
|
|
37
|
+
rdfs:domain wlp:WarehouseLocationProblem ;
|
|
38
|
+
rdfs:range wlp:Objective ;
|
|
39
|
+
rdfs:comment "The objective of the Warehouse Location Problem" .
|
|
40
|
+
|
|
41
|
+
wlp:Objective a owl:Class ;
|
|
42
|
+
rdfs:subClassOf owl:Thing ;
|
|
43
|
+
rdfs:comment "The objective of the Warehouse Location Problem is to minimize the sum of maintenance and supply costs by determining which warehouses to open and assigning them to supply stores." .
|
|
44
|
+
|
|
45
|
+
wlp:hasConstraint a owl:ObjectProperty ;
|
|
46
|
+
rdfs:domain wlp:WarehouseLocationProblem ;
|
|
47
|
+
rdfs:range wlp:Constraint ;
|
|
48
|
+
rdfs:comment "The constraints of the Warehouse Location Problem" .
|
|
49
|
+
|
|
50
|
+
wlp:Constraint a owl:Class ;
|
|
51
|
+
rdfs:subClassOf owl:Thing ;
|
|
52
|
+
rdfs:comment "The constraints of the Warehouse Location Problem are that each store must be supplied by exactly one warehouse and the supply costs vary per warehouse." .
|