Skip to content

Commit c4ccf9e

Browse files
mpsijmniemela
authored andcommitted
Clarify some types for data in problem.yaml
Fixes C1, C2, C3, and C5 from #372.
1 parent bd90c82 commit c4ccf9e

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

spec/2023-07-draft.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Any unknown keys should be treated as an error.
144144
Key | Type | Required | Default
145145
------------------------------------------------- | --------------------------------------------- | --------- | -------
146146
[problem_format_version](#problem-format-version) | String | Yes |
147-
[type](#type) | String or sequence of strings | No | `pass-fail`
147+
[type](#type) | String or non-empty sequence of strings | No | `pass-fail`
148148
[name](#name) | String or map of strings | Yes |
149149
[uuid](#uuid-and-version) | String | Yes |
150150
[version](#uuid-and-version) | String | No |
@@ -155,7 +155,7 @@ Key | Type
155155
[embargo-until](#problem-publication-embargo) | Date | No |
156156
[limits](#limits) | Map with keys as defined below | No | See below
157157
[keywords](#keywords) | Sequence of strings | No |
158-
[languages](#languages) | String or sequence of strings | No | `all`
158+
[languages](#languages) | String or non-empty sequence of strings | No | `all`
159159
[allow_file_writing](#allow-file-writing) | Boolean | No | `false`
160160
[constants](#constants) | Map of strings to int, float, or string | No |
161161

@@ -172,7 +172,7 @@ Documentation for version `<version>` is available at `https://www.kattis.com/pr
172172
### Type
173173

174174
Type of problem.
175-
Must be either a single string or a sequence of strings, from the table below, with no repetition.
175+
Must be either a single string or a non-empty sequence of strings, from the table below, with no repetition.
176176
Two values listed as incompatible must not both be in the sequence.
177177

178178
Value | Incompatible with | Comments
@@ -187,7 +187,7 @@ Value | Incompatible with | Comments
187187

188188
The name of the problem in each language for which a problem statement exists.
189189
If there are statements in more than one language, the `name` field must be a map with the language codes as keys and the problem names as values.
190-
The set of languages for which `name` is given must **exactly** match the set of languages for which a problem statement exists.
190+
The set of languages for which `name` is given must **exactly** match the set of languages for which a [problem statement](#problem-statements) exists.
191191

192192
A deliberately complex and construed example:
193193
```yaml
@@ -220,15 +220,16 @@ This specification currently does not imply any more semantic meaning to these f
220220

221221
Map specifying who should get credits for creating this problem.
222222
A person is specified as a string with the full name, optionally followed by an email wrapped in `<>`, (e.g.: `Full Name` or `Full Name <[email protected]>`).
223+
Each of the keys in this section is optional.
223224

224-
Key | Type | Comments
225-
------------------ | ---------------------------------------| --------
226-
`authors` | Person or sequence of persons | The people who conceptualized the problem.
227-
`contributors` | Person or sequence of persons | The people who developed the problem package, such as the statement, validators, and test data.
228-
`testers` | Person or sequence of persons | The people who tested the problem package, for example, by providing a solution and reviewing the statement.
229-
`translators` | Map of strings to sequences of persons | The people who translated the statement to other languages. Each key must be a language code as described in [General Requirements](#general-requirements).
230-
`packagers` | Person or sequence of persons | The people who created the problem package out of an existing problem.
231-
`acknowledgements` | Person or sequence of persons | Extra acknowledgements or special thanks in addition to the previously mentioned.
225+
Key | Type | Comments
226+
------------------ | ----------------------------------------------------------- | --------
227+
`authors` | Person or non-empty sequence of persons | The people who conceptualized the problem.
228+
`contributors` | Person or non-empty sequence of persons | The people who developed the problem package, such as the statement, validators, and test data.
229+
`testers` | Person or non-empty sequence of persons | The people who tested the problem package, for example, by providing a solution and reviewing the statement.
230+
`translators` | Map of strings to persons or non-empty sequences of persons | The people who translated the statement to other languages. Each key must be a language code as described in [General Requirements](#general-requirements).
231+
`packagers` | Person or non-empty sequence of persons | The people who created the problem package out of an existing problem.
232+
`acknowledgements` | Person or non-empty sequence of persons | Extra acknowledgements or special thanks in addition to the previously mentioned.
232233

233234
A full example would be
234235
```yaml
@@ -316,28 +317,28 @@ Values other than `unknown` or `public domain` require `rights_owner` to have a
316317
### Problem Publication Embargo
317318
318319
The `embargo-until` key, if present, declares that the problem package should not be made publicly available (in problem archives, online judges, etc.) until a certain date and time.
319-
The value of this key must be a calendar date, or date and time of day in UTC, in ISO-8601 extended format (`YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`).
320+
The value of this key must be a calendar date, or date and time of day in UTC, in ISO-8601 extended format (`YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`).
320321
The time defaults to the start of the day in UTC.
321322
322323
### Limits
323324
324325
Time, memory, and other limits to be imposed on submissions.
325326
A map with the following keys:
326327
327-
Key | Comments | Default | Typical system default
328-
-------------------- | -------------------------- | -------------- | ----------------------
329-
`time_multipliers` | optional | see below |
330-
`time_limit` | optional float, in seconds | see below |
331-
`time_resolution` | optional float, in seconds | 1.0 |
332-
`memory` | optional, in MiB | system default | 2048
333-
`output` | optional, in MiB | system default | 8
334-
`code` | optional, in KiB | system default | 128
335-
`compilation_time` | optional, in seconds | system default | 60
336-
`compilation_memory` | optional, in MiB | system default | 2048
337-
`validation_time` | optional, in seconds | system default | 60
338-
`validation_memory` | optional, in MiB | system default | 2048
339-
`validation_output` | optional, in MiB | system default | 8
340-
`validation_passes` | optional | 2 |
328+
Key | Comments | Default | Typical system default
329+
-------------------- | ------------------------------ | -------------- | ----------------------
330+
`time_multipliers` | optional | see below |
331+
`time_limit` | optional float > 0, in seconds | see below |
332+
`time_resolution` | optional float > 0, in seconds | 1.0 |
333+
`memory` | optional int > 0, in MiB | system default | 2048
334+
`output` | optional int > 0, in MiB | system default | 8
335+
`code` | optional int > 0, in KiB | system default | 128
336+
`compilation_time` | optional int > 0, in seconds | system default | 60
337+
`compilation_memory` | optional int > 0, in MiB | system default | 2048
338+
`validation_time` | optional int > 0, in seconds | system default | 60
339+
`validation_memory` | optional int > 0, in MiB | system default | 2048
340+
`validation_output` | optional int > 0, in MiB | system default | 8
341+
`validation_passes` | optional int >= 1 | 2 |
341342
342343
For most keys, the system default will be used if nothing is specified.
343344
This can vary, but you **should** assume that it's reasonable.
@@ -347,10 +348,10 @@ Only specify limits when the problem needs a specific limit, but do specify limi
347348
348349
`time_multipliers` is a map with the following keys:
349350
350-
Key | Comments | Default
351-
------------------- | -------- | -------
352-
`ac_to_time_limit` | float | 2.0
353-
`time_limit_to_tle` | float | 1.5
351+
Key | Comments | Default
352+
------------------- | ---------- | -------
353+
`ac_to_time_limit` | float >= 1 | 2.0
354+
`time_limit_to_tle` | float >= 1 | 1.5
354355
355356
The value of `time_limit` is an integer or floating-point problem time limit in seconds.
356357
The time multipliers specify safety margins relative to the slowest accepted submission, `T_ac`, and fastest time_limit_exceeded submission, `T_tle`.
@@ -359,7 +360,7 @@ In these calculations, `T_tle` is treated as infinity if the problem does not pr
359360
360361
If no `time_limit` is provided, the default value is the smallest integer multiple of `time_resolution` that satisfies the above inequalities.
361362
It is an error if no such multiple exists.
362-
The `time_resolution` key is ignored if the problem provides an explicit time limit (and in particular,
363+
The `time_resolution` key is ignored if the problem provides an explicit time limit (and in particular,
363364
the time limit is not required to be a multiple of the resolution).
364365
Since time multipliers are more future-proof than absolute time limits, avoid specifying `time_limit` whenever practical.
365366
@@ -369,12 +370,11 @@ and should warn when importing a problem whose time limit is specified with prec
369370
### Keywords
370371
371372
List of keywords describing the problem.
372-
Keywords should not contain spaces.
373373
374374
### Languages
375375
376-
List of programming languages codes from the [languages table](../appendix/languages.md) or the string `all`.
377-
If the value is not `all`, the problem may only be solved using the listed programming languages.
376+
List of one or more programming languages codes from the [languages table](../appendix/languages.md) or the string `all`.
377+
If the value is not `all`, the problem may only be solved using any supported programming languages.
378378
379379
File endings in parenthesis are not used for determining language.
380380

0 commit comments

Comments
 (0)