PySMT 0.9.7.dev479__tar.gz → 0.9.7.dev485__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 (165) hide show
  1. {pysmt-0.9.7.dev479/PySMT.egg-info → pysmt-0.9.7.dev485}/PKG-INFO +1 -1
  2. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485/PySMT.egg-info}/PKG-INFO +1 -1
  3. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/PySMT.egg-info/SOURCES.txt +1 -0
  4. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/docs/getting_started.rst +86 -0
  5. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/docs/tutorials.rst +11 -0
  6. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/__init__.py +1 -1
  7. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/install.py +1 -1
  8. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/optimization/z3.py +25 -29
  9. pysmt-0.9.7.dev485/pysmt/test/test_doc_snippets.py +75 -0
  10. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/LICENSE +0 -0
  11. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/MANIFEST.in +0 -0
  12. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/NOTICE +0 -0
  13. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/PySMT.egg-info/dependency_links.txt +0 -0
  14. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/PySMT.egg-info/entry_points.txt +0 -0
  15. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/PySMT.egg-info/top_level.txt +0 -0
  16. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/README.rst +0 -0
  17. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/docs/CHANGES.rst +0 -0
  18. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/docs/api_ref.rst +0 -0
  19. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/docs/development.rst +0 -0
  20. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/docs/index.rst +0 -0
  21. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/docs/tutorials/boolean_logic.rst +0 -0
  22. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/__main__.py +0 -0
  23. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/__init__.py +0 -0
  24. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/check_version.py +0 -0
  25. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/__init__.py +0 -0
  26. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/base.py +0 -0
  27. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/bdd.py +0 -0
  28. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/btor.py +0 -0
  29. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/cvcfive.py +0 -0
  30. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/cvcfour.py +0 -0
  31. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/msat.py +0 -0
  32. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/optimsat.py +0 -0
  33. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/pico.py +0 -0
  34. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/yices.py +0 -0
  35. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/installers/z3.py +0 -0
  36. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/cmd/shell.py +0 -0
  37. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/configuration.py +0 -0
  38. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/constants.py +0 -0
  39. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/decorators.py +0 -0
  40. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/environment.py +0 -0
  41. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/exceptions.py +0 -0
  42. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/factory.py +0 -0
  43. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/fnode.py +0 -0
  44. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/formula.py +0 -0
  45. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/logics.py +0 -0
  46. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/operators.py +0 -0
  47. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/optimization/__init__.py +0 -0
  48. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/optimization/goal.py +0 -0
  49. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/optimization/msat.py +0 -0
  50. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/optimization/optimizer.py +0 -0
  51. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/optimization/optimsat.py +0 -0
  52. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/optimization/yices.py +0 -0
  53. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/oracles.py +0 -0
  54. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/parsing.py +0 -0
  55. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/printers.py +0 -0
  56. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/rewritings.py +0 -0
  57. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/shortcuts.py +0 -0
  58. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/simplifier.py +0 -0
  59. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/smtlib/__init__.py +0 -0
  60. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/smtlib/annotations.py +0 -0
  61. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/smtlib/commands.py +0 -0
  62. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/smtlib/parser/__init__.py +0 -0
  63. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/smtlib/parser/parser.py +0 -0
  64. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/smtlib/printers.py +0 -0
  65. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/smtlib/script.py +0 -0
  66. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/smtlib/solver.py +0 -0
  67. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/smtlib/utils.py +0 -0
  68. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/__init__.py +0 -0
  69. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/bdd.py +0 -0
  70. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/btor.py +0 -0
  71. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/cvcfive.py +0 -0
  72. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/cvcfour.py +0 -0
  73. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/dynmsat.py +0 -0
  74. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/eager.py +0 -0
  75. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/interpolation.py +0 -0
  76. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/msat.py +0 -0
  77. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/options.py +0 -0
  78. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/pico.py +0 -0
  79. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/portfolio.py +0 -0
  80. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/qelim.py +0 -0
  81. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/smtlib.py +0 -0
  82. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/solver.py +0 -0
  83. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/yices.py +0 -0
  84. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/solvers/z3.py +0 -0
  85. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/substituter.py +0 -0
  86. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/__init__.py +0 -0
  87. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/configs/config1.ini +0 -0
  88. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/configs/config_bad.ini +0 -0
  89. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/examples.py +0 -0
  90. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/omt_examples.py +0 -0
  91. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/optimization_utils.py +0 -0
  92. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/__init__.py +0 -0
  93. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/parser_utils.py +0 -0
  94. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_annotations.py +0 -0
  95. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_fuzzed.py +0 -0
  96. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_generic_wrapper.py +0 -0
  97. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_griggio.py +0 -0
  98. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_model_validation.py +0 -0
  99. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_omt_lib_solver.py +0 -0
  100. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_examples.py +0 -0
  101. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_extensibility.py +0 -0
  102. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_lra.py +0 -0
  103. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_omt.py +0 -0
  104. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_qf_arrays.py +0 -0
  105. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_qf_lia.py +0 -0
  106. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_qf_lira.py +0 -0
  107. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_qf_lra.py +0 -0
  108. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_qf_nia.py +0 -0
  109. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_qf_nra.py +0 -0
  110. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_qf_uf.py +0 -0
  111. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_qf_ufbv.py +0 -0
  112. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_parser_type_error.py +0 -0
  113. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/smtlib/test_smtlibscript.py +0 -0
  114. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_array.py +0 -0
  115. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_back.py +0 -0
  116. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_bdd.py +0 -0
  117. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_bv.py +0 -0
  118. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_bv_simplification.py +0 -0
  119. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_cnf.py +0 -0
  120. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_configuration.py +0 -0
  121. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_constants.py +0 -0
  122. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_cvc_quantifiers.py +0 -0
  123. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_dwf.py +0 -0
  124. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_eager_model.py +0 -0
  125. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_env.py +0 -0
  126. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_euf.py +0 -0
  127. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_formula.py +0 -0
  128. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_hr_parsing.py +0 -0
  129. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_imports.py +0 -0
  130. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_int.py +0 -0
  131. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_interpolation.py +0 -0
  132. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_lira.py +0 -0
  133. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_logics.py +0 -0
  134. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_models.py +0 -0
  135. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_native_qe.py +0 -0
  136. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_nia.py +0 -0
  137. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_nlira.py +0 -0
  138. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_optimization.py +0 -0
  139. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_optimizing.py +0 -0
  140. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_oracles.py +0 -0
  141. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_portfolio.py +0 -0
  142. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_printing.py +0 -0
  143. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_qe.py +0 -0
  144. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_regressions.py +0 -0
  145. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_rewritings.py +0 -0
  146. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_shannon_expansion.py +0 -0
  147. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_simplify.py +0 -0
  148. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_size.py +0 -0
  149. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_solving.py +0 -0
  150. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_sorts.py +0 -0
  151. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_string.py +0 -0
  152. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_typechecker.py +0 -0
  153. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_unsat_cores.py +0 -0
  154. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_walker_ext.py +0 -0
  155. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/test/test_walkers.py +0 -0
  156. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/type_checker.py +0 -0
  157. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/typing.py +0 -0
  158. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/utils.py +0 -0
  159. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/walkers/__init__.py +0 -0
  160. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/walkers/dag.py +0 -0
  161. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/walkers/generic.py +0 -0
  162. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/walkers/identitydag.py +0 -0
  163. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/pysmt/walkers/tree.py +0 -0
  164. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/setup.cfg +0 -0
  165. {pysmt-0.9.7.dev479 → pysmt-0.9.7.dev485}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySMT
3
- Version: 0.9.7.dev479
3
+ Version: 0.9.7.dev485
4
4
  Summary: A solver-agnostic library for SMT Formulae manipulation and solving
5
5
  Home-page: http://www.pysmt.org
6
6
  Author: PySMT Team
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySMT
3
- Version: 0.9.7.dev479
3
+ Version: 0.9.7.dev485
4
4
  Summary: A solver-agnostic library for SMT Formulae manipulation and solving
5
5
  Home-page: http://www.pysmt.org
6
6
  Author: PySMT Team
@@ -98,6 +98,7 @@ pysmt/test/test_cnf.py
98
98
  pysmt/test/test_configuration.py
99
99
  pysmt/test/test_constants.py
100
100
  pysmt/test/test_cvc_quantifiers.py
101
+ pysmt/test/test_doc_snippets.py
101
102
  pysmt/test/test_dwf.py
102
103
  pysmt/test/test_eager_model.py
103
104
  pysmt/test/test_env.py
@@ -222,6 +222,88 @@ Here is the complete example for reference using the logic QF_LIA:
222
222
  .. literalinclude:: code_snippets/hello_world_qf_lia.py
223
223
 
224
224
 
225
+ .. _gs-unsat-core:
226
+
227
+ Unsat Cores
228
+ -----------
229
+
230
+ When a set of formulae is unsatisfiable, not all of them are usually
231
+ responsible for the unsatisfiability. An *unsat core* of the asserted
232
+ formulae is a subset of them whose conjunction is still
233
+ unsatisfiable. UNSAT cores are a handy debugging tool because they
234
+ narrow down which assertions of your problem are in conflict. The
235
+ core returned by the solver is not guaranteed to be minimal: removing
236
+ a formula from it may leave it unsatisfiable.
237
+
238
+ pySMT exposes two ways to obtain an unsat core, both provided by the
239
+ :py:class:`~pysmt.solvers.solver.UnsatCoreSolver` class:
240
+
241
+ * ``get_unsat_core()`` returns the core as a set of formulae (this is
242
+ also what the :py:func:`~pysmt.shortcuts.get_unsat_core` shortcut
243
+ uses);
244
+ * ``get_named_unsat_core()`` returns the core as a dictionary mapping
245
+ assertion names to formulae.
246
+
247
+ Named cores are useful when the assertions come from different
248
+ sources (e.g. different rules of a constraint, different parts of the
249
+ input), because the names allow you to map the core back to the
250
+ structure of your original problem.
251
+
252
+ Core extraction must be enabled when the solver is created, through
253
+ the ``unsat_cores_mode`` option of
254
+ :py:func:`~pysmt.shortcuts.UnsatCoreSolver`:
255
+
256
+ * ``"all"`` (the default of the shortcut): every assertion is a
257
+ candidate for the core. Use it when you only need the formulae.
258
+ * ``"named"``: only the assertions added with
259
+ ``add_assertion(f, named="...")`` are candidates, and
260
+ ``get_named_unsat_core()`` reports them under the given names. Use it
261
+ when you need to map the core back to your problem, or when only
262
+ some of the assertions should be tracked.
263
+
264
+ .. note::
265
+
266
+ Not every solver supports unsat-core extraction. You can list the
267
+ installed solvers that do by looking at the result of
268
+ ``Factory.all_unsat_core_solvers()`` (see
269
+ :py:meth:`pysmt.factory.Factory.all_unsat_core_solvers`); as of this
270
+ writing the supported solvers are z3, MathSAT/OptiMathSAT and
271
+ Boolector, while cvc5 and Yices do not.
272
+ ``UnsatCoreSolver(...)`` raises
273
+ :py:class:`~pysmt.exceptions.NoSolverAvailableError` if no installed
274
+ solver supports unsat cores for the requested logic.
275
+
276
+ Minimal example
277
+ """""""""""""""
278
+
279
+ .. literalinclude:: code_snippets/unsat_core.py
280
+
281
+ Named cores
282
+ """""""""""
283
+
284
+ .. literalinclude:: code_snippets/unsat_core_named.py
285
+
286
+ .. note::
287
+
288
+ Named cores are meaningful only when the solver is created with
289
+ ``unsat_cores_mode="named"``. In the other modes, some solvers
290
+ (e.g. z3) keep the names that were given to the assertions while
291
+ others (e.g. MathSAT, Boolector) replace them with generated,
292
+ meaningless names; only ``unsat_cores_mode="named"`` is therefore
293
+ portable if you rely on the names.
294
+
295
+ Cores under assumptions
296
+ """""""""""""""""""""""
297
+
298
+ Assumptions are extra constraints that apply only to a particular call
299
+ of ``solve()``, not to the solver's theory. The following snippet
300
+ shows that ``get_unsat_core()`` reports the assumptions that belong to
301
+ the core (in both unsat cores modes), while ``get_named_unsat_core()``
302
+ never does, since assumptions carry no name.
303
+
304
+ .. literalinclude:: code_snippets/unsat_core_assumptions.py
305
+
306
+
225
307
  What's Next?
226
308
  ------------
227
309
 
@@ -232,3 +314,7 @@ there with a simple to use interface.
232
314
 
233
315
  To understand more about other functionalities of pySMT, you can take
234
316
  a look at the `examples/ folder <https://github.com/pysmt/pysmt/blob/master/examples/README.rst>`_ .
317
+
318
+ If a problem you are trying to solve is unsatisfiable, you can
319
+ use unsat-core extraction to debug it: see the :ref:`gs-unsat-core`
320
+ section above for an introduction.
@@ -62,6 +62,17 @@ Demonstrates how to perform SMT-LIB parsing, dumping and extension
62
62
  ------------------------------------------------------------------
63
63
  .. literalinclude:: ../examples/smtlib.py
64
64
 
65
+ Unsat Cores
66
+ -----------
67
+
68
+ pySMT can extract an *unsat core* of an unsatisfiable set of
69
+ formulae: a subset of the asserted formulae whose conjunction is
70
+ still unsatisfiable. This is a handy debugging tool to find out
71
+ which assertions of your problem are in conflict. See the
72
+ :ref:`gs-unsat-core` section of the getting started guide for a
73
+ full walkthrough, and note that the example below (``examples/einstein.py``)
74
+ already uses UNSAT cores.
75
+
65
76
  Shows the use of UNSAT Core as debugging tools
66
77
  ----------------------------------------------
67
78
  .. literalinclude:: ../examples/einstein.py
@@ -19,7 +19,7 @@
19
19
  from typing import Tuple, Union
20
20
 
21
21
 
22
- VERSION: Union[Tuple[int, int, int], Tuple[int, int, int, str, int]] = (0, 9, 7, "dev", 479)
22
+ VERSION: Union[Tuple[int, int, int], Tuple[int, int, int, str, int]] = (0, 9, 7, "dev", 485)
23
23
 
24
24
  # Try to provide human-readable version of latest commit for dev versions
25
25
  # E.g. v0.5.1-4-g49a49f2-wip
@@ -36,7 +36,7 @@ INSTALLERS = [
36
36
  Installer(CVC5Installer, "1.3.3", {}),
37
37
  Installer(CVC4Installer, "1.7-prerelease",
38
38
  {"git_version" : "391ab9df6c3fd9a3771864900c1718534c1e4666"}),
39
- Installer(Z3Installer, "4.15.0", {}),
39
+ Installer(Z3Installer, "5.1.0", {}),
40
40
  Installer(YicesInstaller, "2.6.4", {"yices_api_version": "1.1.5"}),
41
41
  Installer(BtorInstaller, "3.2.3", {}),
42
42
  Installer(PicoSATInstaller, "965",
@@ -18,8 +18,6 @@
18
18
 
19
19
  from __future__ import absolute_import
20
20
 
21
- from warnings import warn
22
-
23
21
  from pysmt.decorators import clear_pending_pop
24
22
  from pysmt.solvers.solver import Model
25
23
  from pysmt.solvers.z3 import Z3Solver, Z3Model
@@ -127,33 +125,31 @@ class Z3NativeOptimizer(Optimizer, Z3Solver):
127
125
 
128
126
  @clear_pending_pop
129
127
  def boxed_optimize(self, goals: Sequence[Goal]) -> Optional[Dict[Goal, Tuple[Model, FNode]]]:
130
- # This implementation is a naive simulation of a box optimization,
131
- # but is needed to cope with an upstream Z3 issue:
132
- # https://github.com/Z3Prover/z3/issues/7240
133
- #
134
- # A properer implementation would be as follows.
135
- # '''python
136
- # self.z3.set(priority='box')
137
- # models = {}
138
- # for goal_id, goal in enumerate(goals):
139
- # self._assert_z3_goal(goal, goal_id)
140
- # for goal in goals:
141
- # if self.z3.check() == z3.sat:
142
- # model = Z3Model(self.environment, self.z3.model())
143
- # models[goal] = (model, model.get_value(goal.term()))
144
- # else:
145
- # return None
146
- # return models
147
- # '''
148
- warn("Boxed optimization is not working in Z3 (see https://github.com/Z3Prover/z3/issues/7240). "
149
- "PySMT will simulate the correct behavior, but the performance will be sub-optimal")
150
- models = {}
151
- for g in goals:
152
- r = self.optimize(g)
153
- if r is None:
154
- return None
155
- models[g] = r
156
- return models
128
+ self.push()
129
+ try:
130
+ self.z3.set(priority='box')
131
+ handles = [self._assert_z3_goal(goal, goal_id)
132
+ for goal_id, goal in enumerate(goals)]
133
+ # In box mode, each call to check() yields the optimal model
134
+ # of the next objective, in the order they were asserted
135
+ models: Dict[Goal, Tuple[Model, FNode]] = {}
136
+ for goal, h in zip(goals, handles):
137
+ if self.z3.check() != z3.sat:
138
+ return None
139
+ try:
140
+ model = Z3Model(self.environment, self.z3.model())
141
+ if goal.is_maxsmt_goal():
142
+ models[goal] = (model, self._compute_max_smt_cost(model, goal))
143
+ else:
144
+ self.converter.back(self.z3.lower(h))
145
+ models[goal] = (model, model.get_value(goal.term()))
146
+ except PysmtInfinityError:
147
+ raise PysmtUnboundedOptimizationError("The optimal value is unbounded")
148
+ except PysmtInfinitesimalError:
149
+ raise PysmtInfinitesimalError("The optimal value is infinitesimal")
150
+ return models
151
+ finally:
152
+ self.pop()
157
153
 
158
154
  @clear_pending_pop
159
155
  def lexicographic_optimize(self, goals: Sequence[Goal]) -> Optional[Tuple[Model, List[FNode]]]:
@@ -0,0 +1,75 @@
1
+ #
2
+ # This file is part of pySMT.
3
+ #
4
+ # Copyright 2014 Andrea Micheli and Marco Gario
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ import os
19
+ import runpy
20
+ import unittest
21
+
22
+ from pysmt.test import (TestCase, skipIfSolverNotAvailable,
23
+ skipIfNoSolverForLogic,
24
+ skipIfNoUnsatCoreSolverForLogic, main)
25
+ from pysmt.logics import QF_LIA
26
+
27
+
28
+ SNIPPETS_DIR = os.path.join(os.path.dirname(__file__),
29
+ "..", "..", "docs", "code_snippets")
30
+
31
+
32
+ # The docs are not shipped with the package, so skip when run from an install.
33
+ @unittest.skipIf(not os.path.isdir(SNIPPETS_DIR), "docs/ not available")
34
+ class TestDocSnippets(TestCase):
35
+
36
+ def setUp(self):
37
+ super().setUp()
38
+ # Match the default environment a reader gets from pysmt.shortcuts.
39
+ self.env.enable_infix_notation = True
40
+
41
+ def run_snippets(self, *names):
42
+ for name in names:
43
+ with self.subTest(snippet=name):
44
+ runpy.run_path(os.path.join(SNIPPETS_DIR, name + ".py"),
45
+ run_name="__main__")
46
+
47
+ def test_no_solver(self):
48
+ self.run_snippets("hello_world_opening", "hello_world_infix")
49
+
50
+ @skipIfNoSolverForLogic(QF_LIA)
51
+ def test_qf_lia(self):
52
+ self.run_snippets("hello_world_is_sat", "hello_world_get_model",
53
+ "hello_world_qf_lia")
54
+
55
+ @skipIfSolverNotAvailable("z3")
56
+ def test_z3(self):
57
+ self.run_snippets("hello_world")
58
+
59
+ @skipIfNoUnsatCoreSolverForLogic(QF_LIA)
60
+ def test_unsat_cores(self):
61
+ self.run_snippets("unsat_core", "unsat_core_named",
62
+ "unsat_core_assumptions")
63
+
64
+ def test_all_snippets_are_tested(self):
65
+ tested = {"hello_world_opening", "hello_world_infix",
66
+ "hello_world_is_sat", "hello_world_get_model",
67
+ "hello_world_qf_lia", "hello_world", "unsat_core",
68
+ "unsat_core_named", "unsat_core_assumptions"}
69
+ found = {f[:-3] for f in os.listdir(SNIPPETS_DIR) if f.endswith(".py")}
70
+ self.assertEqual(found, tested,
71
+ "Add new docs/code_snippets files to this test")
72
+
73
+
74
+ if __name__ == '__main__':
75
+ main()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes