combinatory-synthesizer 0.0.1.dev2__tar.gz → 0.0.1.dev22__tar.gz

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.
Files changed (75) hide show
  1. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.github/workflows/benchmarks.yml +12 -18
  2. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.github/workflows/build-nightly.yml +7 -2
  3. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.github/workflows/check-docs.yml +1 -1
  4. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.github/workflows/checks.yml +1 -1
  5. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.github/workflows/deploy-docs.yml +1 -1
  6. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.github/workflows/pr-rules-develop.yml +1 -1
  7. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.github/workflows/pr-rules-main.yml +1 -1
  8. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.github/workflows/pre-release.yml +1 -1
  9. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.github/workflows/release.yml +1 -1
  10. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/PKG-INFO +14 -6
  11. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/README.md +10 -2
  12. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/benchmarks/test_benchmark_maximal_elements.py +2 -1
  13. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/benchmarks/test_benchmark_maze.py +8 -9
  14. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/benchmarks/test_benchmark_maze_contains.py +8 -9
  15. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/benchmarks/test_benchmark_maze_loopfree.py +9 -10
  16. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/features/constraints.md +4 -4
  17. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/quick-start.md +3 -3
  18. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/examples/example_constraints.py +12 -9
  19. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/examples/example_constraints_inline.py +12 -9
  20. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/examples/example_fibonacci.py +10 -8
  21. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/examples/example_fibonacci_linear.py +10 -7
  22. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/pyproject.toml +9 -3
  23. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/src/cosy/_version.py +2 -2
  24. combinatory_synthesizer-0.0.1.dev22/src/cosy/core/__init__.py +17 -0
  25. {combinatory_synthesizer-0.0.1.dev2/src/cosy → combinatory_synthesizer-0.0.1.dev22/src/cosy/core}/inspector.py +2 -2
  26. combinatory_synthesizer-0.0.1.dev22/src/cosy/core/solution_space.py +696 -0
  27. {combinatory_synthesizer-0.0.1.dev2/src/cosy → combinatory_synthesizer-0.0.1.dev22/src/cosy/core}/specification_builder.py +3 -3
  28. {combinatory_synthesizer-0.0.1.dev2/src/cosy → combinatory_synthesizer-0.0.1.dev22/src/cosy/core}/subtypes.py +38 -7
  29. {combinatory_synthesizer-0.0.1.dev2/src/cosy → combinatory_synthesizer-0.0.1.dev22/src/cosy/core}/synthesizer.py +16 -14
  30. combinatory_synthesizer-0.0.1.dev22/src/cosy/extensions/__init__.py +6 -0
  31. combinatory_synthesizer-0.0.1.dev22/src/cosy/extensions/solutions.py +52 -0
  32. combinatory_synthesizer-0.0.1.dev22/src/cosy/extensions/visualization/collapsible_tree.html +45 -0
  33. combinatory_synthesizer-0.0.1.dev22/src/cosy/extensions/visualization/script.js +474 -0
  34. combinatory_synthesizer-0.0.1.dev22/src/cosy/extensions/visualize.py +211 -0
  35. combinatory_synthesizer-0.0.1.dev22/src/cosy/maestro/__init__.py +5 -0
  36. {combinatory_synthesizer-0.0.1.dev2/src/cosy → combinatory_synthesizer-0.0.1.dev22/src/cosy/maestro}/maestro.py +12 -8
  37. combinatory_synthesizer-0.0.1.dev22/tests/__init__.py +0 -0
  38. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/tests/test_combinatorics.py +14 -13
  39. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/tests/test_contains_tree.py +5 -4
  40. combinatory_synthesizer-0.0.1.dev22/tests/test_enumerate_artificial_solution_space.py +56 -0
  41. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/tests/test_group_underspecification.py +6 -4
  42. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/tests/test_infinite_enumeration.py +6 -5
  43. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/tests/test_intersect_arguments.py +12 -4
  44. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/tests/test_literal_candidates.py +32 -3
  45. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/tests/test_literal_inference.py +5 -4
  46. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/tests/test_no_prune.py +3 -2
  47. combinatory_synthesizer-0.0.1.dev22/tests/test_overlapping_substitution_inference.py +93 -0
  48. combinatory_synthesizer-0.0.1.dev2/src/cosy/__init__.py +0 -19
  49. combinatory_synthesizer-0.0.1.dev2/src/cosy/solution_space.py +0 -365
  50. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.github/dependabot.yml +0 -0
  51. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/.gitignore +0 -0
  52. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/CITATION.cff +0 -0
  53. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/LICENSE.txt +0 -0
  54. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/benchmarks/__init__.py +0 -0
  55. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/.overrides/partials/copyright.html +0 -0
  56. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/about/authors.md +0 -0
  57. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/assets/badges/mypy.json +0 -0
  58. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/assets/images/logo.svg +0 -0
  59. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/bibliographies/applications.bib +0 -0
  60. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/bibliographies/theory.bib +0 -0
  61. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/examples/introduction.md +0 -0
  62. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/features/advanced.md +0 -0
  63. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/guidelines/best-practice.md +0 -0
  64. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/guidelines/troubleshoot.md +0 -0
  65. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/index.md +0 -0
  66. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/docs/stylesheets/extra.css +0 -0
  67. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/hatch.toml +0 -0
  68. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/mkdocs.yml +0 -0
  69. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/scripts/gen_example_pages.py +0 -0
  70. {combinatory_synthesizer-0.0.1.dev2 → combinatory_synthesizer-0.0.1.dev22}/scripts/gen_reference_pages.py +0 -0
  71. {combinatory_synthesizer-0.0.1.dev2/tests → combinatory_synthesizer-0.0.1.dev22/src/cosy}/__init__.py +0 -0
  72. {combinatory_synthesizer-0.0.1.dev2/src/cosy → combinatory_synthesizer-0.0.1.dev22/src/cosy/core}/combinatorics.py +0 -0
  73. {combinatory_synthesizer-0.0.1.dev2/src/cosy → combinatory_synthesizer-0.0.1.dev22/src/cosy/core}/py.typed +0 -0
  74. {combinatory_synthesizer-0.0.1.dev2/src/cosy → combinatory_synthesizer-0.0.1.dev22/src/cosy/core}/tree.py +0 -0
  75. {combinatory_synthesizer-0.0.1.dev2/src/cosy → combinatory_synthesizer-0.0.1.dev22/src/cosy/core}/types.py +0 -0
@@ -5,7 +5,7 @@ on:
5
5
  branches:
6
6
  - main
7
7
  - develop
8
- pull_request:
8
+ pull_request_target:
9
9
  branches:
10
10
  - main
11
11
  - develop
@@ -34,19 +34,17 @@ jobs:
34
34
  private-key: ${{ secrets.TUDO_SEAL_WORKFLOW_PRIVATE_KEY }}
35
35
  repositories: |
36
36
  cosy
37
- cosy-benchmarks
37
+ cosy-benchmarks
38
38
 
39
- - uses: actions/checkout@v5
39
+ - uses: actions/checkout@v6
40
40
  with:
41
41
  repository: tudo-seal/cosy-benchmarks
42
- token: ${{ steps.tudo-seal-workflow-token.outputs.token }}
43
42
  ref: 'gh-pages'
44
43
 
45
- - uses: actions/checkout@v5
44
+ - uses: actions/checkout@v6
46
45
  with:
47
46
  # Full history for timestamps
48
47
  fetch-depth: 0
49
- token: ${{ steps.tudo-seal-workflow-token.outputs.token }}
50
48
  path: 'cosy-nested'
51
49
 
52
50
  - name: Set up Python
@@ -57,21 +55,17 @@ jobs:
57
55
  - name: Install Hatch
58
56
  uses: pypa/hatch@install
59
57
 
58
+ - name: Fetch PR branch from fork
59
+ if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
60
+ run: gh pr checkout ${{ github.event.number }}
61
+ env:
62
+ GH_TOKEN: ${{ steps.tudo-seal-workflow-token.outputs.token }}
63
+ working-directory: 'cosy-nested'
64
+
60
65
  - name: Run Benchmark Suite
61
66
  run: hatch test benchmarks --benchmark-json benchmarks.json
62
67
  working-directory: 'cosy-nested'
63
68
 
64
- - name: Config Git
65
- run: |
66
- git config user.name "tudo-seal-workflows[bot]"
67
- git config user.email "244727884+tudo-seal-workflows[bot]@users.noreply.github.com"
68
-
69
- - name: Determine Push Or Not
70
- if: github.event_name != 'pull_request'
71
- run: |
72
- echo "PUSH_TO_BENCHMARKS=true" >> $GITHUB_ENV
73
- echo "COMMENT_ALWAYS=false" >> $GITHUB_ENV
74
-
75
69
  - name: Store Benchmark Result
76
70
  uses: benchmark-action/github-action-benchmark@v1
77
71
  with:
@@ -86,4 +80,4 @@ jobs:
86
80
  comment-always: ${{ env.COMMENT_ALWAYS }}
87
81
  summary-always: true
88
82
  gh-repository: 'github.com/tudo-seal/cosy-benchmarks'
89
- benchmark-data-dir-path: '${{ env.BRANCH_NAME }}/benchmarks'
83
+ benchmark-data-dir-path: '${{ env.BRANCH_NAME }}/benchmarks'
@@ -18,7 +18,7 @@ jobs:
18
18
  app-id: ${{ secrets.TUDO_SEAL_WORKFLOW_CLIENT_ID }}
19
19
  private-key: ${{ secrets.TUDO_SEAL_WORKFLOW_PRIVATE_KEY }}
20
20
 
21
- - uses: actions/checkout@v5
21
+ - uses: actions/checkout@v6
22
22
  with:
23
23
  # Full history for timestamps
24
24
  fetch-depth: 0
@@ -43,6 +43,10 @@ jobs:
43
43
  - name: Build Package
44
44
  run: hatch build
45
45
 
46
+ - name: Stable Url
47
+ run: |
48
+ cp dist/combinatory_synthesizer-${{ env.NIGHTLY_VERSION }}.tar.gz dist/combinatory_synthesizer-nightly.tar.gz
49
+
46
50
  - name: Convert nightly to draft
47
51
  run: gh release edit --draft "${{ env.nightly_tag }}" || true
48
52
  env:
@@ -75,4 +79,5 @@ jobs:
75
79
  GH_TOKEN: ${{ steps.tudo-seal-workflow-token.outputs.token }}
76
80
  ARTIFACTS: >
77
81
  dist/combinatory_synthesizer-${{ env.NIGHTLY_VERSION }}.tar.gz
78
- dist/combinatory_synthesizer-${{ env.NIGHTLY_VERSION }}-py3-none-any.whl
82
+ dist/combinatory_synthesizer-nightly.tar.gz
83
+ dist/combinatory_synthesizer-${{ env.NIGHTLY_VERSION }}-py3-none-any.whl
@@ -19,7 +19,7 @@ jobs:
19
19
  check-docs:
20
20
  runs-on: ubuntu-latest
21
21
  steps:
22
- - uses: actions/checkout@v5
22
+ - uses: actions/checkout@v6
23
23
  with:
24
24
  # Full history for timestamps
25
25
  fetch-depth: 0
@@ -36,7 +36,7 @@ jobs:
36
36
  python-version: ['3.10', '3.11', '3.12', '3.13']
37
37
 
38
38
  steps:
39
- - uses: actions/checkout@v5
39
+ - uses: actions/checkout@v6
40
40
 
41
41
  - name: Set up Python ${{ matrix.python-version }}
42
42
  uses: actions/setup-python@v6
@@ -22,7 +22,7 @@ jobs:
22
22
  needs: [pre-deploy-docs-checks]
23
23
  runs-on: ubuntu-latest
24
24
  steps:
25
- - uses: actions/checkout@v5
25
+ - uses: actions/checkout@v6
26
26
  with:
27
27
  # Full history for timestamps
28
28
  fetch-depth: 0
@@ -22,7 +22,7 @@ jobs:
22
22
  app-id: ${{ secrets.TUDO_SEAL_WORKFLOW_CLIENT_ID }}
23
23
  private-key: ${{ secrets.TUDO_SEAL_WORKFLOW_PRIVATE_KEY }}
24
24
 
25
- - uses: actions/checkout@v5
25
+ - uses: actions/checkout@v6
26
26
  with:
27
27
  # Full history for timestamps
28
28
  fetch-depth: 0
@@ -22,7 +22,7 @@ jobs:
22
22
  app-id: ${{ secrets.TUDO_SEAL_WORKFLOW_CLIENT_ID }}
23
23
  private-key: ${{ secrets.TUDO_SEAL_WORKFLOW_PRIVATE_KEY }}
24
24
 
25
- - uses: actions/checkout@v5
25
+ - uses: actions/checkout@v6
26
26
  with:
27
27
  # Full history for timestamps
28
28
  fetch-depth: 0
@@ -21,7 +21,7 @@ jobs:
21
21
  environment: pre-release
22
22
  runs-on: ubuntu-latest
23
23
  steps:
24
- - uses: actions/checkout@v5
24
+ - uses: actions/checkout@v6
25
25
  with:
26
26
  # Full history for timestamps
27
27
  fetch-depth: 0
@@ -22,7 +22,7 @@ jobs:
22
22
  environment: release
23
23
  runs-on: ubuntu-latest
24
24
  steps:
25
- - uses: actions/checkout@v5
25
+ - uses: actions/checkout@v6
26
26
  with:
27
27
  # Full history for timestamps
28
28
  fetch-depth: 0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: combinatory-synthesizer
3
- Version: 0.0.1.dev2
3
+ Version: 0.0.1.dev22
4
4
  Summary: Type based synthesis framework using inhabitation in FCLP
5
- Project-URL: Documentation, https://github.com/Jekannadar/cosy#readme
6
- Project-URL: Issues, https://github.com/Jekannadar/cosy/issues
7
- Project-URL: Source, https://github.com/Jekannadar/cosy
5
+ Project-URL: Documentation, https://tudo-seal.github.io/cosy/
6
+ Project-URL: Issues, https://github.com/tudo-seal/cosy/issues
7
+ Project-URL: Source, https://github.com/tudo-seal/cosy
8
8
  Author-email: Constantin Chaumet <constantin.chaumet@tu-dortmund.de>, Andrej Dudenhefner <andrej.dudenhefner@cs.tu-dortmund.de>, Felix Laarmann <felix.laarmann@tu-dortmund.de>, Christoph Stahl <christoph.stahl@tu-dortmund.de>
9
9
  License-Expression: Apache-2.0
10
10
  License-File: LICENSE.txt
@@ -31,7 +31,7 @@ Description-Content-Type: text/markdown
31
31
  | Package | [![CI - Test](https://img.shields.io/github/actions/workflow/status/tudo-seal/cosy/checks.yml?label=checks&style=flat-square)](https://github.com/tudo-seal/cosy/actions/workflows/checks.yml) [![CD - Release CoSy](https://img.shields.io/github/actions/workflow/status/tudo-seal/cosy/release.yml?label=release&style=flat-square)](https://github.com/tudo-seal/cosy/actions/workflows/release.yml) |
32
32
  | Docs | [![Docs - Release](https://img.shields.io/github/actions/workflow/status/tudo-seal/cosy/check-docs.yml?label=checks&style=flat-square)](https://github.com/tudo-seal/cosy/actions/workflows/check-docs.yml) [![Docs - Checks](https://img.shields.io/github/actions/workflow/status/tudo-seal/cosy/deploy-docs.yml?label=deploy&style=flat-square)](https://github.com/tudo-seal/cosy/actions/workflows/deploy-docs.yml) |
33
33
  | Coverage | [![codecov](https://img.shields.io/codecov/c/github/tudo-seal/cosy?token=40E83ABJV4&logo=codecov&label=&labelColor=grey&style=flat-square)](https://codecov.io/github/tudo-seal/cosy) |
34
- | Traits | [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg?style=flat-square)](https://hatch.pypa.io/latest/) [![Checked with mypy](https://img.shields.io/badge/endpoint?url=https://raw.githubusercontent.com/tudo-seal/cosy/main/docs/assets/badges/mypy.json&style=flat-square)](http://mypy-lang.org/) [![Checked with Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&color=4051b5&style=flat-square)](https://github.com/astral-sh/ruff) |
34
+ | Traits | [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg?style=flat-square)](https://hatch.pypa.io/latest/) [![Checked with mypy](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftudo-seal%2Fcosy%2Fmain%2Fdocs%2Fassets%2Fbadges%2Fmypy.json&style=flat-square)](http://mypy-lang.org/) [![Checked with Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&color=4051b5&style=flat-square)](https://github.com/astral-sh/ruff) |
35
35
 
36
36
  </div>
37
37
 
@@ -69,7 +69,15 @@ Examples currently all employ the `Maestro`.
69
69
  Installation is as simple as running:
70
70
 
71
71
  ```console
72
- pip install combinatory-synthesizer
72
+ pip install --pre combinatory-synthesizer
73
+ ```
74
+
75
+ Since `CoSy` is still in pre-release state, `PyPi` distributions are likely to be outdated most of the time.
76
+
77
+ If you want to stay up to date with a nightly build:
78
+
79
+ ```console
80
+ pip install https://github.com/tudo-seal/cosy/releases/download/nightly/combinatory_synthesizer-nightly.tar.gz
73
81
  ```
74
82
 
75
83
  `CoSy` itself has no dependencies at all, so it will play nice with any pre-existing projects.
@@ -11,7 +11,7 @@
11
11
  | Package | [![CI - Test](https://img.shields.io/github/actions/workflow/status/tudo-seal/cosy/checks.yml?label=checks&style=flat-square)](https://github.com/tudo-seal/cosy/actions/workflows/checks.yml) [![CD - Release CoSy](https://img.shields.io/github/actions/workflow/status/tudo-seal/cosy/release.yml?label=release&style=flat-square)](https://github.com/tudo-seal/cosy/actions/workflows/release.yml) |
12
12
  | Docs | [![Docs - Release](https://img.shields.io/github/actions/workflow/status/tudo-seal/cosy/check-docs.yml?label=checks&style=flat-square)](https://github.com/tudo-seal/cosy/actions/workflows/check-docs.yml) [![Docs - Checks](https://img.shields.io/github/actions/workflow/status/tudo-seal/cosy/deploy-docs.yml?label=deploy&style=flat-square)](https://github.com/tudo-seal/cosy/actions/workflows/deploy-docs.yml) |
13
13
  | Coverage | [![codecov](https://img.shields.io/codecov/c/github/tudo-seal/cosy?token=40E83ABJV4&logo=codecov&label=&labelColor=grey&style=flat-square)](https://codecov.io/github/tudo-seal/cosy) |
14
- | Traits | [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg?style=flat-square)](https://hatch.pypa.io/latest/) [![Checked with mypy](https://img.shields.io/badge/endpoint?url=https://raw.githubusercontent.com/tudo-seal/cosy/main/docs/assets/badges/mypy.json&style=flat-square)](http://mypy-lang.org/) [![Checked with Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&color=4051b5&style=flat-square)](https://github.com/astral-sh/ruff) |
14
+ | Traits | [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg?style=flat-square)](https://hatch.pypa.io/latest/) [![Checked with mypy](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftudo-seal%2Fcosy%2Fmain%2Fdocs%2Fassets%2Fbadges%2Fmypy.json&style=flat-square)](http://mypy-lang.org/) [![Checked with Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&color=4051b5&style=flat-square)](https://github.com/astral-sh/ruff) |
15
15
 
16
16
  </div>
17
17
 
@@ -49,7 +49,15 @@ Examples currently all employ the `Maestro`.
49
49
  Installation is as simple as running:
50
50
 
51
51
  ```console
52
- pip install combinatory-synthesizer
52
+ pip install --pre combinatory-synthesizer
53
+ ```
54
+
55
+ Since `CoSy` is still in pre-release state, `PyPi` distributions are likely to be outdated most of the time.
56
+
57
+ If you want to stay up to date with a nightly build:
58
+
59
+ ```console
60
+ pip install https://github.com/tudo-seal/cosy/releases/download/nightly/combinatory_synthesizer-nightly.tar.gz
53
61
  ```
54
62
 
55
63
  `CoSy` itself has no dependencies at all, so it will play nice with any pre-existing projects.
@@ -3,7 +3,8 @@
3
3
  from random import Random
4
4
 
5
5
  import pytest
6
- from cosy.combinatorics import maximal_elements
6
+
7
+ from cosy.core.combinatorics import maximal_elements
7
8
 
8
9
 
9
10
  @pytest.fixture
@@ -2,9 +2,10 @@ from collections.abc import Callable, Mapping
2
2
  from itertools import product
3
3
 
4
4
  import pytest
5
- from cosy.specification_builder import SpecificationBuilder
6
- from cosy.synthesizer import Specification, Synthesizer
7
- from cosy.types import Constructor, DataGroup, Literal, Type, Var
5
+
6
+ from cosy.core.specification_builder import SpecificationBuilder
7
+ from cosy.core.synthesizer import Specification, Synthesizer
8
+ from cosy.core.types import Constructor, DataGroup, Literal, Type, Var
8
9
 
9
10
 
10
11
  def is_free(pos: tuple[int, int]) -> bool:
@@ -16,12 +17,10 @@ def is_free(pos: tuple[int, int]) -> bool:
16
17
 
17
18
 
18
19
  @pytest.fixture
19
- def component_specifications() -> (
20
- Mapping[
21
- Callable[[tuple[int, int], tuple[int, int], str], str] | str,
22
- Specification,
23
- ]
24
- ):
20
+ def component_specifications() -> Mapping[
21
+ Callable[[tuple[int, int], tuple[int, int], str], str] | str,
22
+ Specification,
23
+ ]:
25
24
  def up(b: tuple[int, int], _a: tuple[int, int], p: str) -> str:
26
25
  return f"{p} => UP({b})"
27
26
 
@@ -1,9 +1,10 @@
1
1
  from collections.abc import Callable, Mapping
2
2
 
3
3
  import pytest
4
- from cosy.specification_builder import SpecificationBuilder
5
- from cosy.synthesizer import Specification, Synthesizer
6
- from cosy.types import Constructor, Group, Literal, Type, Var
4
+
5
+ from cosy.core.specification_builder import SpecificationBuilder
6
+ from cosy.core.synthesizer import Specification, Synthesizer
7
+ from cosy.core.types import Constructor, Group, Literal, Type, Var
7
8
 
8
9
 
9
10
  def is_free(pos: tuple[int, int]) -> bool:
@@ -18,12 +19,10 @@ SIZE = 50
18
19
 
19
20
 
20
21
  @pytest.fixture
21
- def component_specifications() -> (
22
- Mapping[
23
- Callable[[tuple[int, int], tuple[int, int], str], str] | str,
24
- Specification,
25
- ]
26
- ):
22
+ def component_specifications() -> Mapping[
23
+ Callable[[tuple[int, int], tuple[int, int], str], str] | str,
24
+ Specification,
25
+ ]:
27
26
  def up(b: tuple[int, int], _a: tuple[int, int], p: str) -> str:
28
27
  return f"{p} => UP({b})"
29
28
 
@@ -2,10 +2,11 @@ from collections.abc import Callable, Iterable, Mapping
2
2
  from itertools import product
3
3
 
4
4
  import pytest
5
- from cosy.specification_builder import SpecificationBuilder
6
- from cosy.synthesizer import Specification, Synthesizer
7
- from cosy.tree import Tree
8
- from cosy.types import Constructor, DataGroup, Literal, Type, Var
5
+
6
+ from cosy.core.specification_builder import SpecificationBuilder
7
+ from cosy.core.synthesizer import Specification, Synthesizer
8
+ from cosy.core.tree import Tree
9
+ from cosy.core.types import Constructor, DataGroup, Literal, Type, Var
9
10
 
10
11
 
11
12
  def is_free(pos: tuple[int, int]) -> bool:
@@ -17,12 +18,10 @@ def is_free(pos: tuple[int, int]) -> bool:
17
18
 
18
19
 
19
20
  @pytest.fixture
20
- def component_specifications() -> (
21
- Mapping[
22
- Callable[[tuple[int, int], tuple[int, int], str], str] | str,
23
- Specification,
24
- ]
25
- ):
21
+ def component_specifications() -> Mapping[
22
+ Callable[[tuple[int, int], tuple[int, int], str], str] | str,
23
+ Specification,
24
+ ]:
26
25
  def up(b: tuple[int, int], _a: tuple[int, int], p: str) -> str:
27
26
  return f"{p} => UP({b})"
28
27
 
@@ -20,20 +20,20 @@ def one(s: str) -> str:
20
20
  ```
21
21
  These binary sequences are assigned names and specifications, forming a triple:
22
22
  ```
23
- ( #
23
+ (
24
24
  "empty",
25
25
  empty,
26
26
  SpecificationBuilder()
27
27
  .suffix(Constructor("str")),
28
28
  ),
29
- ( #
29
+ (
30
30
  "zero",
31
31
  zero,
32
32
  SpecificationBuilder()
33
33
  .argument("s", Constructor("str"))
34
34
  .suffix(Constructor("str")),
35
35
  ),
36
- ( #
36
+ (
37
37
  "one",
38
38
  one,
39
39
  SpecificationBuilder()
@@ -56,7 +56,7 @@ def fin(_b: bool, s: str) -> str:
56
56
  ```
57
57
  with triple:
58
58
  ```
59
- ( #
59
+ (
60
60
  "fin",
61
61
  fin,
62
62
  SpecificationBuilder()
@@ -32,19 +32,19 @@ def fib_next(_z: int, _y: int, _x: int, f1 : int, f2: int) -> int:
32
32
  return f1 + f2
33
33
 
34
34
  named_components_with_specifications = [
35
- ( #
35
+ (
36
36
  "fib_zero",
37
37
  fib_zero,
38
38
  SpecificationBuilder()
39
39
  .suffix(Constructor("fib") & Constructor("at", Literal(0))),
40
40
  ),
41
- ( #
41
+ (
42
42
  "fib_one",
43
43
  fib_one,
44
44
  SpecificationBuilder()
45
45
  .suffix(Constructor("fib") & Constructor("at", Literal(1))),
46
46
  ),
47
- ( #
47
+ (
48
48
  "fib_next",
49
49
  fib_next,
50
50
  SpecificationBuilder()
@@ -5,9 +5,9 @@ Demonstrates constraints in CoSy.
5
5
 
6
6
  import re
7
7
 
8
- from cosy import Maestro
9
- from cosy.specification_builder import SpecificationBuilder
10
- from cosy.types import Constructor, Group, Literal, Type, Var
8
+ from cosy.core.specification_builder import SpecificationBuilder
9
+ from cosy.core.types import Constructor, Group, Literal, Type, Var
10
+ from cosy.maestro import Maestro
11
11
 
12
12
 
13
13
  def empty() -> str:
@@ -64,22 +64,22 @@ def main():
64
64
  pass
65
65
 
66
66
  named_components_with_specifications = [
67
- ( #
67
+ (
68
68
  "empty",
69
69
  empty,
70
70
  SpecificationBuilder().suffix(Constructor("str")),
71
71
  ),
72
- ( #
72
+ (
73
73
  "zero",
74
74
  zero,
75
75
  SpecificationBuilder().argument("s", Constructor("str")).suffix(Constructor("str")),
76
76
  ),
77
- ( #
77
+ (
78
78
  "one",
79
79
  one,
80
80
  SpecificationBuilder().argument("s", Constructor("str")).suffix(Constructor("str")),
81
81
  ),
82
- ( #
82
+ (
83
83
  "fin",
84
84
  fin,
85
85
  SpecificationBuilder()
@@ -96,8 +96,11 @@ def main():
96
96
  # Query for heavy strings
97
97
  target: Type = Constructor("matches", Literal("01+0"))
98
98
 
99
- # Query the Maestro with the target and print results
100
- for result in maestro.query(target):
99
+ # Query the Maestro with the target, then visualize and print results
100
+ results = maestro.query(target)
101
+ results.visualize(amount=3)
102
+ print("Now printing all infinite results in order:")
103
+ for result in results:
101
104
  print(result)
102
105
 
103
106
 
@@ -5,9 +5,9 @@ Demonstrates constraints in CoSy, highlighting how the Component class can be us
5
5
 
6
6
  import re
7
7
 
8
- from cosy import Maestro
9
- from cosy.specification_builder import SpecificationBuilder
10
- from cosy.types import Constructor, Group, Literal, Type, Var
8
+ from cosy.core.specification_builder import SpecificationBuilder
9
+ from cosy.core.types import Constructor, Group, Literal, Type, Var
10
+ from cosy.maestro import Maestro
11
11
 
12
12
 
13
13
  def main():
@@ -22,22 +22,22 @@ def main():
22
22
  pass
23
23
 
24
24
  named_components_with_specifications = [
25
- ( #
25
+ (
26
26
  "empty",
27
27
  lambda: "",
28
28
  SpecificationBuilder().suffix(Constructor("str")),
29
29
  ),
30
- ( #
30
+ (
31
31
  "zero",
32
32
  lambda s: s + "0",
33
33
  SpecificationBuilder().argument("s", Constructor("str")).suffix(Constructor("str")),
34
34
  ),
35
- ( #
35
+ (
36
36
  "one",
37
37
  lambda s: s + "1",
38
38
  SpecificationBuilder().argument("s", Constructor("str")).suffix(Constructor("str")),
39
39
  ),
40
- ( #
40
+ (
41
41
  "fin",
42
42
  lambda _, s: s,
43
43
  SpecificationBuilder()
@@ -54,8 +54,11 @@ def main():
54
54
  # Query for heavy strings
55
55
  target: Type = Constructor("matches", Literal("01+0"))
56
56
 
57
- # Query the Maestro with the target and print results
58
- for result in maestro.query(target):
57
+ # Query the Maestro with the target, then visualize and print results
58
+ results = maestro.query(target)
59
+ results.visualize(amount=3)
60
+ print("Now printing all infinite results in order:")
61
+ for result in results:
59
62
  print(result)
60
63
 
61
64
 
@@ -3,9 +3,9 @@
3
3
  Overall description of this example goes here.
4
4
  """
5
5
 
6
- from cosy import Maestro
7
- from cosy.specification_builder import SpecificationBuilder
8
- from cosy.types import Constructor, DataGroup, Literal, Type, Var
6
+ from cosy.core.specification_builder import SpecificationBuilder
7
+ from cosy.core.types import Constructor, DataGroup, Literal, Type, Var
8
+ from cosy.maestro import Maestro
9
9
 
10
10
 
11
11
  def fib_zero() -> int:
@@ -46,17 +46,17 @@ def main():
46
46
  bound = 20
47
47
 
48
48
  named_components_with_specifications = [
49
- ( #
49
+ (
50
50
  "fib_zero",
51
51
  fib_zero,
52
52
  SpecificationBuilder().suffix(Constructor("fib") & Constructor("at", Literal(0))),
53
53
  ),
54
- ( #
54
+ (
55
55
  "fib_one",
56
56
  fib_one,
57
57
  SpecificationBuilder().suffix(Constructor("fib") & Constructor("at", Literal(1))),
58
58
  ),
59
- ( #
59
+ (
60
60
  "fib_next",
61
61
  fib_next,
62
62
  SpecificationBuilder()
@@ -75,9 +75,11 @@ def main():
75
75
  # Target describing Fibonacci numbers at relevant indices
76
76
  target: Type = Constructor("fib")
77
77
 
78
- # Query the Maestro with the target and print the compositions
79
- for result in maestro.query(target):
78
+ # Query the Maestro with the target, then visualize and print results
79
+ results = maestro.query(target)
80
+ for result in results:
80
81
  print(result)
82
+ results.visualize()
81
83
 
82
84
  for i in range(20):
83
85
  # Target for Fibonacci numbers at index i
@@ -3,9 +3,9 @@
3
3
  Overall description of this example goes here.
4
4
  """
5
5
 
6
- from cosy import Maestro
7
- from cosy.specification_builder import SpecificationBuilder
8
- from cosy.types import Constructor, Group, Literal, Var
6
+ from cosy.core.specification_builder import SpecificationBuilder
7
+ from cosy.core.types import Constructor, Group, Literal, Var
8
+ from cosy.maestro import Maestro
9
9
 
10
10
 
11
11
  def fst(_x: int, f: tuple[int, int]) -> int:
@@ -53,7 +53,7 @@ def main():
53
53
  yield from frozenset(range(self._bound))
54
54
 
55
55
  component_specifications = [
56
- ( #
56
+ (
57
57
  "fst",
58
58
  fst,
59
59
  SpecificationBuilder()
@@ -61,12 +61,12 @@ def main():
61
61
  .argument("f", Constructor("fibs") & Constructor("at", Var("x")))
62
62
  .suffix(Constructor("fib") & Constructor("at", Var("x"))),
63
63
  ),
64
- ( #
64
+ (
65
65
  "fib_zero_one",
66
66
  fib_zero_one,
67
67
  SpecificationBuilder().suffix(Constructor("fibs") & Constructor("at", Literal(0))),
68
68
  ),
69
- ( #
69
+ (
70
70
  "fib_next",
71
71
  fib_next,
72
72
  SpecificationBuilder()
@@ -84,7 +84,10 @@ def main():
84
84
  target = Constructor("fib") & Constructor("at", Literal(5000))
85
85
 
86
86
  # Query the Maestro with the target and print the only composition
87
- print("5000th Fibonacci number:", next(iter(maestro.query(target))))
87
+ results = maestro.query(target)
88
+ print("5000th Fibonacci number:", next(iter(results)))
89
+ # Visualize that result
90
+ results.visualize()
88
91
 
89
92
 
90
93
  if __name__ == "__main__":
@@ -30,9 +30,9 @@ dependencies = []
30
30
 
31
31
 
32
32
  [project.urls]
33
- Documentation = "https://github.com/Jekannadar/cosy#readme"
34
- Issues = "https://github.com/Jekannadar/cosy/issues"
35
- Source = "https://github.com/Jekannadar/cosy"
33
+ Documentation = "https://tudo-seal.github.io/cosy/"
34
+ Issues = "https://github.com/tudo-seal/cosy/issues"
35
+ Source = "https://github.com/tudo-seal/cosy"
36
36
 
37
37
 
38
38
  [tool.hatch.version]
@@ -41,6 +41,7 @@ source = "vcs"
41
41
 
42
42
  [tool.hatch.version.raw-options]
43
43
  local_scheme = "no-local-version"
44
+ version_scheme = "guess-next-dev"
44
45
 
45
46
 
46
47
  [tool.hatch.build.hooks.vcs]
@@ -97,3 +98,8 @@ exclude_lines = [
97
98
  "FBT",
98
99
  ]
99
100
 
101
+ [tool.setuptools.packages.find]
102
+ where = ["src"]
103
+
104
+ [tool.setuptools.package-data]
105
+ cosy.extensions.visualization = ["*"]
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.0.1.dev2'
32
- __version_tuple__ = version_tuple = (0, 0, 1, 'dev2')
31
+ __version__ = version = '0.0.1.dev22'
32
+ __version_tuple__ = version_tuple = (0, 0, 1, 'dev22')
33
33
 
34
34
  __commit_id__ = commit_id = None