Skip to content

Commit ec68ca5

Browse files
committed
Added taint_date, the date at which a puzzle was added to the repo. AI systems trained after that date may have seen the puzzle and its solution.
1 parent 4b9caab commit ec68ca5

File tree

14 files changed

+16385
-7192
lines changed

14 files changed

+16385
-7192
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ or [contribute through pull requests](../../wiki/How-to-add-a-puzzle).
1111
To learn more about how well AI systems such as GPT-3 can solve these problems, read our paper:
1212

1313
[Programming Puzzles](https://arxiv.org/abs/2106.05784). Tal Schuster, Ashwin Kalyan, Oleksandr Polozov,
14-
Adam Tauman Kalai.
14+
Adam Tauman Kalai. In *Proceedings of the Thirty-fifth Conference on Neural Information Processing Systems Datasets
15+
and Benchmarks Track* (NeurIPS), 2021.
1516
```
16-
@misc{schuster2021programming,
17-
title={Programming Puzzles},
18-
author={Tal Schuster and Ashwin Kalyan and Oleksandr Polozov and Adam Tauman Kalai},
19-
year={2021},
20-
eprint={2106.05784},
21-
archivePrefix={arXiv},
17+
@inproceedings{
18+
schuster2021programming,
19+
title={Programming Puzzles},
20+
author={Tal Schuster and Ashwin Kalyan and Alex Polozov and Adam Tauman Kalai},
21+
booktitle={Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track},
22+
year={2021},
23+
url={https://openreview.net/forum?id=fe_hCc4RBrg}
2224
}
2325
```
2426

generators/ICPC.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
class BiPermutations(PuzzleGenerator):
1313
"""
1414
Inspired by
15-
[ICPC 2019 Problem A: Azulejos](https://icpc.global/newcms/worldfinals/problems/2019%20ACM-ICPC%20World%20Finals/icpc2019.pdf)
15+
[ICPC 2019 Problem A: Azulejos](https://icpc.global/worldfinals/problems/2019%20ACM-ICPC%20World%20Finals/icpc2019.pdf)
1616
which is 2,287 characters.
1717
"""
18+
taint_date = [2019, 3, 31]
1819

1920
@staticmethod
2021
def sat(perms: List[List[int]],
@@ -79,9 +80,10 @@ def gen_random(self):
7980
class OptimalBridges(PuzzleGenerator):
8081
"""
8182
Inspired by
82-
[ICPC 2019 Problem B: Bridges](https://icpc.global/newcms/worldfinals/problems/2019%20ACM-ICPC%20World%20Finals/icpc2019.pdf)
83+
[ICPC 2019 Problem B: Bridges](https://icpc.global/worldfinals/problems/2019%20ACM-ICPC%20World%20Finals/icpc2019.pdf)
8384
which is 3,003 characters.
8485
"""
86+
taint_date = [2019, 3, 31]
8587

8688
@staticmethod
8789
def sat(indices: List[int],
@@ -189,10 +191,11 @@ def gen_random(self):
189191
class CheckersPosition(PuzzleGenerator):
190192
"""
191193
Inspired by
192-
[ICPC 2019 Problem C: Checks Post Facto](https://icpc.global/newcms/worldfinals/problems/2019%20ACM-ICPC%20World%20Finals/icpc2019.pdf)
194+
[ICPC 2019 Problem C: Checks Post Facto](https://icpc.global/worldfinals/problems/2019%20ACM-ICPC%20World%20Finals/icpc2019.pdf)
193195
194196
Nobody solved this problem during the competition -- it is pretty difficult!
195197
"""
198+
taint_date = [2019, 3, 31]
196199

197200
@staticmethod
198201
def sat(position: List[List[int]], transcript=[[[3, 3], [5, 5], [3, 7]], [[5, 3], [6, 4]]]):
@@ -437,10 +440,11 @@ def make_random_move(sign): # returns True if move was made else False if no le
437440
class MatchingMarkers(PuzzleGenerator):
438441
"""
439442
Inspired by
440-
[ICPC 2019 Problem D: Circular DNA](https://icpc.global/newcms/worldfinals/problems/2019%20ACM-ICPC%20World%20Finals/icpc2019.pdf)
443+
[ICPC 2019 Problem D: Circular DNA](https://icpc.global/worldfinals/problems/2019%20ACM-ICPC%20World%20Finals/icpc2019.pdf)
441444
442445
This is trivial in quadratic time, but the challenge is to solve it quickly (i.e., linear time).
443446
"""
447+
taint_date = [2019, 3, 31]
444448

445449
@staticmethod
446450
def sat(cut_position: int, ring="yRrsmOkLCHSDJywpVDEDsjgCwSUmtvHMefxxPFdmBIpM", lower=5):

generators/IMO.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class ExponentialCoinMoves(PuzzleGenerator):
2020
2121
Inspired by [IMO 2010 Problem 5](https://www.imo-official.org/problems.aspx)"""
2222

23-
timeout = 10 # sat can run 10 times longer than normal
23+
multiplier = 10 # worth 10 times normal so that it can run 10 times longer than normal
24+
taint_date = [2010, 7, 2]
2425

2526
@staticmethod
2627
def sat(states: List[List[int]], n=16385):
@@ -103,6 +104,9 @@ class NoRelativePrimes(PuzzleGenerator):
103104
theorem?
104105
"""
105106

107+
taint_date = [2016, 7, 1]
108+
109+
106110
@staticmethod
107111
def sat(nums: List[int], b=6, m=2):
108112
"""
@@ -184,6 +188,8 @@ class FindRepeats(PuzzleGenerator):
184188
Inspired by [IMO 2017 Problem 1](https://www.imo-official.org/problems.aspx)
185189
"""
186190

191+
taint_date = [2017, 7, 12]
192+
187193
@staticmethod
188194
def sat(indices: List[int], a0=123):
189195
"""
@@ -231,6 +237,8 @@ class PickNearNeighbors(PuzzleGenerator):
231237
232238
The puzzle solution follows the judge's proof closely."""
233239

240+
taint_date = [2017, 7, 12]
241+
234242
@staticmethod
235243
def sat(keep: List[bool], heights=[10, 2, 14, 1, 8, 19, 16, 6, 12, 3, 17, 0, 9, 18, 5, 7, 11, 13, 15, 4]):
236244
"""
@@ -293,6 +301,8 @@ class FindProductiveList(PuzzleGenerator):
293301
Inspired by [IMO 2010 Problem 5](https://www.imo-official.org/problems.aspx)
294302
"""
295303

304+
taint_date = [2010, 7, 2]
305+
296306
@staticmethod
297307
def sat(li: List[int], n=18):
298308
"""
@@ -324,6 +334,8 @@ def gen(self, target_num_instances):
324334
class HalfTag(PuzzleGenerator):
325335
"""Inspired by [IMO 2020 Problem 3](https://www.imo-official.org/problems.aspx)"""
326336

337+
taint_date = [2020, 9, 19]
338+
327339
@staticmethod
328340
def sat(li: List[int], n=3, tags=[0, 1, 2, 0, 0, 1, 1, 1, 2, 2, 0, 2]):
329341
"""
@@ -410,20 +422,6 @@ def gen_random(self):
410422
self.add(dict(n=n, tags=tags))
411423

412424

413-
# Inspired by IMO 2017 Problem 6. See https://www.imo-official.org/problems.aspx
414-
# ----
415-
# The problem asks for the n+1 coefficients given the relatively prime pairs. The solution seems involved
416-
# and has not yet been implemented.
417-
# """
418-
#
419-
# pairs = [[4, 1], [5, 3], [8, 21]]
420-
#
421-
#
422-
# def sat(li: List[int]):
423-
# n = len(li) - 1
424-
# return n > 0 and all(sum(c * x ** (n - i) * y ** i for i, c in enumerate(li)) == 1 for x, y in pairs)
425-
#
426-
427425

428426
if __name__ == "__main__":
429427
PuzzleGenerator.debug_problems()

generators/algebra.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66

77
# See https://github.com/microsoft/PythonProgrammingPuzzles/wiki/How-to-add-a-puzzle to learn about adding puzzles
88

9+
class AlgebraGen:
10+
blah = 17
11+
taint_date = [2021, 4, 26]
912

10-
class QuadraticRoot(PuzzleGenerator):
13+
14+
15+
class QuadraticRoot(AlgebraGen, PuzzleGenerator):
1116
"""See [quadratic equations](https://en.wikipedia.org/wiki/Quadratic_formula)"""
1217

1318
@staticmethod

generators/classic_puzzles.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class TowersOfHanoi(PuzzleGenerator):
1414
In this classic version one must move all 8 disks from the first to third peg."""
1515

1616
@staticmethod
17-
def sat(moves: List[List[int]]): # moves is list of [from, to] pairs
17+
def sat(moves: List[List[int]]):
1818
"""
1919
Eight disks of sizes 1-8 are stacked on three towers, with each tower having disks in order of largest to
2020
smallest. Move [i, j] corresponds to taking the smallest disk off tower i and putting it on tower j, and it
@@ -458,9 +458,10 @@ class SquaringTheSquare(PuzzleGenerator):
458458
"""
459459

460460
@staticmethod
461-
def sat(xy_sides: List[List[int]]): # List of (x, y, side)
461+
def sat(xy_sides: List[List[int]]):
462462
"""
463463
Partition a square into smaller squares with unique side lengths. A perfect squared path has distinct sides.
464+
xy_sides is a List of (x, y, side)
464465
"""
465466
n = max(x + side for x, y, side in xy_sides)
466467
assert len({side for x, y, side in xy_sides}) == len(xy_sides) > 1

generators/codeforces.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ def gen(self, target_num_instances):
339339
class SortPlusPlus(PuzzleGenerator):
340340
"""Inspired by [Codeforces Problem 339 A](https://codeforces.com/problemset/problem/339/A)"""
341341

342+
342343
@staticmethod
343344
def sat(s: str, inp="1+1+3+1+3+2+2+1+3+1+2"):
344345
"""Sort numbers in a sum of digits, e.g., 1+3+2+1 -> 1+1+2+3"""

generators/games.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Mastermind(PuzzleGenerator):
7979
them to provide a provable winning game tree.
8080
"""
8181

82-
timeout = 10
82+
multiplier = 10 # hard puzzle, takes longer to test
8383

8484
@staticmethod
8585
def sat(transcripts: List[str], max_moves=10):

0 commit comments

Comments
 (0)