xhail2 1.0.0__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 (90) hide show
  1. xhail2-1.0.0/.editorconfig +17 -0
  2. xhail2-1.0.0/.github/workflows/ci.yml +32 -0
  3. xhail2-1.0.0/.gitignore +13 -0
  4. xhail2-1.0.0/CHANGELOG.md +15 -0
  5. xhail2-1.0.0/LICENSE +674 -0
  6. xhail2-1.0.0/PKG-INFO +230 -0
  7. xhail2-1.0.0/README.md +201 -0
  8. xhail2-1.0.0/examples/ec.lp +31 -0
  9. xhail2-1.0.0/examples/empty.lp +0 -0
  10. xhail2-1.0.0/examples/example1.lp +11 -0
  11. xhail2-1.0.0/examples/example2.lp +19 -0
  12. xhail2-1.0.0/examples/example3.lp +19 -0
  13. xhail2-1.0.0/examples/example4.lp +13 -0
  14. xhail2-1.0.0/examples/mwe1.lp +186 -0
  15. xhail2-1.0.0/examples/mwe2.lp +2565 -0
  16. xhail2-1.0.0/examples/penguins_simple.lp +19 -0
  17. xhail2-1.0.0/examples/penguins_unsatisfiable.lp +22 -0
  18. xhail2-1.0.0/examples/penguins_weighted.lp +21 -0
  19. xhail2-1.0.0/examples/phone4_abd.lp +90 -0
  20. xhail2-1.0.0/examples/phone4_complex.lp +219 -0
  21. xhail2-1.0.0/examples/phone4_ded.lp +188 -0
  22. xhail2-1.0.0/examples/phone4_hard.lp +213 -0
  23. xhail2-1.0.0/examples/phone4_hardest.lp +213 -0
  24. xhail2-1.0.0/examples/phone4_ind.lp +195 -0
  25. xhail2-1.0.0/examples/reaction.lp +119 -0
  26. xhail2-1.0.0/logo.png +0 -0
  27. xhail2-1.0.0/pyproject.toml +90 -0
  28. xhail2-1.0.0/src/xhail/__init__.py +1 -0
  29. xhail2-1.0.0/src/xhail/__main__.py +3 -0
  30. xhail2-1.0.0/src/xhail/application.py +181 -0
  31. xhail2-1.0.0/src/xhail/core/__init__.py +0 -0
  32. xhail2-1.0.0/src/xhail/core/config.py +94 -0
  33. xhail2-1.0.0/src/xhail/core/dialler.py +176 -0
  34. xhail2-1.0.0/src/xhail/core/entities/__init__.py +0 -0
  35. xhail2-1.0.0/src/xhail/core/entities/answer.py +126 -0
  36. xhail2-1.0.0/src/xhail/core/entities/answers.py +257 -0
  37. xhail2-1.0.0/src/xhail/core/entities/grounding.py +422 -0
  38. xhail2-1.0.0/src/xhail/core/entities/hypothesis.py +249 -0
  39. xhail2-1.0.0/src/xhail/core/entities/problem.py +381 -0
  40. xhail2-1.0.0/src/xhail/core/entities/values.py +49 -0
  41. xhail2-1.0.0/src/xhail/core/finder.py +107 -0
  42. xhail2-1.0.0/src/xhail/core/logger.py +237 -0
  43. xhail2-1.0.0/src/xhail/core/parser/__init__.py +0 -0
  44. xhail2-1.0.0/src/xhail/core/parser/acquirer.py +91 -0
  45. xhail2-1.0.0/src/xhail/core/parser/parser.py +426 -0
  46. xhail2-1.0.0/src/xhail/core/parser/splitter.py +166 -0
  47. xhail2-1.0.0/src/xhail/core/parser/tokeniser.py +62 -0
  48. xhail2-1.0.0/src/xhail/core/statements/__init__.py +0 -0
  49. xhail2-1.0.0/src/xhail/core/statements/display.py +37 -0
  50. xhail2-1.0.0/src/xhail/core/statements/example.py +59 -0
  51. xhail2-1.0.0/src/xhail/core/statements/mode_b.py +49 -0
  52. xhail2-1.0.0/src/xhail/core/statements/mode_h.py +67 -0
  53. xhail2-1.0.0/src/xhail/core/terms/__init__.py +0 -0
  54. xhail2-1.0.0/src/xhail/core/terms/atom.py +128 -0
  55. xhail2-1.0.0/src/xhail/core/terms/clause.py +76 -0
  56. xhail2-1.0.0/src/xhail/core/terms/literal.py +59 -0
  57. xhail2-1.0.0/src/xhail/core/terms/number.py +22 -0
  58. xhail2-1.0.0/src/xhail/core/terms/placemarker.py +62 -0
  59. xhail2-1.0.0/src/xhail/core/terms/quotation.py +27 -0
  60. xhail2-1.0.0/src/xhail/core/terms/scheme.py +112 -0
  61. xhail2-1.0.0/src/xhail/core/terms/scheme_term.py +224 -0
  62. xhail2-1.0.0/src/xhail/core/terms/term.py +5 -0
  63. xhail2-1.0.0/src/xhail/core/terms/variable.py +23 -0
  64. xhail2-1.0.0/src/xhail/core/utils.py +159 -0
  65. xhail2-1.0.0/tests/core/entities/__init__.py +0 -0
  66. xhail2-1.0.0/tests/core/entities/test_answer_answers.py +678 -0
  67. xhail2-1.0.0/tests/core/entities/test_grounding.py +711 -0
  68. xhail2-1.0.0/tests/core/entities/test_hypothesis.py +537 -0
  69. xhail2-1.0.0/tests/core/entities/test_problem.py +611 -0
  70. xhail2-1.0.0/tests/core/entities/test_values.py +121 -0
  71. xhail2-1.0.0/tests/core/parser/__init__.py +0 -0
  72. xhail2-1.0.0/tests/core/parser/test_parser.py +401 -0
  73. xhail2-1.0.0/tests/core/parser/test_splitter.py +122 -0
  74. xhail2-1.0.0/tests/core/parser/test_tokeniser_acquirer.py +144 -0
  75. xhail2-1.0.0/tests/core/statements/__init__.py +0 -0
  76. xhail2-1.0.0/tests/core/statements/test_display_example.py +192 -0
  77. xhail2-1.0.0/tests/core/statements/test_mode_b_mode_h.py +224 -0
  78. xhail2-1.0.0/tests/core/terms/test_atom_scheme.py +409 -0
  79. xhail2-1.0.0/tests/core/terms/test_literal_clause.py +290 -0
  80. xhail2-1.0.0/tests/core/terms/test_number_quotation.py +111 -0
  81. xhail2-1.0.0/tests/core/terms/test_scheme_term_statics.py +345 -0
  82. xhail2-1.0.0/tests/core/terms/test_term_scheme_term.py +37 -0
  83. xhail2-1.0.0/tests/core/terms/test_variable_placemarker.py +196 -0
  84. xhail2-1.0.0/tests/core/test_config.py +262 -0
  85. xhail2-1.0.0/tests/core/test_dialler.py +517 -0
  86. xhail2-1.0.0/tests/core/test_finder.py +259 -0
  87. xhail2-1.0.0/tests/core/test_logger.py +532 -0
  88. xhail2-1.0.0/tests/core/test_utils.py +436 -0
  89. xhail2-1.0.0/tests/test_application.py +391 -0
  90. xhail2-1.0.0/tests/test_smoke.py +5 -0
@@ -0,0 +1,17 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ indent_style = space
7
+ insert_final_newline = true
8
+ trim_trailing_whitespace = true
9
+
10
+ [*.py]
11
+ indent_size = 4
12
+
13
+ [*.{toml,yml,yaml}]
14
+ indent_size = 2
15
+
16
+ [*.md]
17
+ trim_trailing_whitespace = false
@@ -0,0 +1,32 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ python-version: ["3.14"]
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: ${{ matrix.python-version }}
16
+ - run: pip install -e ".[dev]"
17
+ - run: pytest --cov
18
+
19
+ publish:
20
+ needs: test
21
+ runs-on: ubuntu-latest
22
+ if: startsWith(github.ref, 'refs/tags/v')
23
+ permissions:
24
+ id-token: write
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ - uses: actions/setup-python@v5
28
+ with:
29
+ python-version: "3.14"
30
+ - run: pip install hatch
31
+ - run: hatch build
32
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,13 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ .coverage
6
+ coverage.xml
7
+ .pytest_cache/
8
+ dist/
9
+ build/
10
+ *.egg-info/
11
+ .ruff_cache/
12
+ .hatch/
13
+ temp/
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## [1.0.0] — 2026-06-22
4
+
5
+ Initial release: faithful Python port of the original Java XHAIL implementation.
6
+
7
+ ### Added
8
+
9
+ - Full Python port of the XHAIL abduction/induction/deduction pipeline
10
+ - `Problem`, `Grounding`, `Hypothesis`, `Answer`, `Answers` entities
11
+ - ASP-based solver integration via external Gringo/Clasp v3 binaries
12
+ - `#display`, `#example`, `#modeh`, `#modeb` directive parser
13
+ - Command-line interface (`xhail` entry point) with all original flags
14
+ - 1009-test suite at 93 % coverage
15
+ - Example problems in `examples/toys/`