Skip to content

Commit

Permalink
Make Proof Rule enum a part of the API (cvc5#9925)
Browse files Browse the repository at this point in the history
This pull requests makes the enum that lists all proof rules a part of the API.

It also renames the enum from PfRule to ProofRule. It also renames some unrelated types and function names that share the PfRule name (such as DslPfRule).
This rename unfortunately touches many files since PfRule is not an uncommon type. (second to last commit)
  • Loading branch information
hansjoergschurr authored Sep 27, 2023
1 parent a3f653c commit 0a35879
Show file tree
Hide file tree
Showing 179 changed files with 2,392 additions and 2,001 deletions.
4 changes: 2 additions & 2 deletions docs/api/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set(DOXYGEN_INPUT "\
${DOXYGEN_INPUT_DIR}/cvc5.h \
${DOXYGEN_INPUT_DIR}/cvc5_kind.h \
${DOXYGEN_INPUT_DIR}/cvc5_types.h \
${PROJECT_SOURCE_DIR}/src/proof/proof_rule.h \
${DOXYGEN_INPUT_DIR}/cvc5_proof_rule.h
")
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/xml/index.xml)

Expand All @@ -42,7 +42,7 @@ add_custom_command(
${DOXYGEN_INPUT_DIR}/cvc5.h
${DOXYGEN_INPUT_DIR}/cvc5_kind.h
${DOXYGEN_INPUT_DIR}/cvc5_types.h
${PROJECT_SOURCE_DIR}/src/proof/proof_rule.h
${DOXYGEN_INPUT_DIR}/cvc5_proof_rule.h
COMMENT "Generating doxygen API docs"
)
add_custom_target(docs-cpp DEPENDS ${DOXYGEN_INDEX_FILE})
Expand Down
32 changes: 32 additions & 0 deletions docs/api/java/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,36 @@ if(BUILD_BINDINGS_JAVA)
set(JAVADOC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/build/api/java)
# used to trigger the rebuild
set(JAVADOC_INDEX_FILE ${JAVADOC_OUTPUT_DIR}/index.html)
# HTML added to javadoc to include Mathjax
# This is fragile with respect to escapes:
# - The LaTeX sequence '$#1$' must be written as '\$$#1$$'.
# - Whitespaces in some places must be omitted, otherwise
# they become ';'.
# - To make LaTeX commands work they need '\\\\'.
set(JAVADOC_MATHJAX [=["
<script>
window.MathJax = {
'loader': {
'load': ['[tex]/ams','[tex]/bussproofs'],
},
'tex': {
'packages': {
'[+]': ['ams','bussproofs'],
},
'macros': {
'xor': '\\\\mathbin{xor}',
'ite': ['#1~\\\\mathbin{?}~#2~\\\\mathbin{:}~#3',3],
'inferrule': ['\\\\begin{prooftree}\\\\AxiomC{\$$#1$$}\\\\UnaryInfC{\$$#2$$}\\\\end{prooftree}',2],
'inferruleSC': ['\\\\begin{prooftree}\\\\AxiomC{\$$#1$$}\\\\RightLabel{~#3}\\\\UnaryInfC{\$$#2$$}\\\\end{prooftree}',3],
}
}
}
</script>
<script type='text/javascript' id='MathJax-script' async src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'>
</script>
"]=])
string(REPLACE "\n" " " JAVADOC_MATHJAX ${JAVADOC_MATHJAX})
string(REPLACE " " ";" JAVADOC_MATHJAX ${JAVADOC_MATHJAX})

get_target_property(CVC5_JAR_FILE cvc5jar JAR_FILE)
add_custom_command(
Expand All @@ -32,6 +62,8 @@ if(BUILD_BINDINGS_JAVA)
-d ${JAVADOC_OUTPUT_DIR}
-cp ${CVC5_JAR_FILE}
-tag "api.note:a:Note:"
--allow-script-in-comments
-header ${JAVADOC_MATHJAX}
-notimestamp
COMMAND find ${JAVADOC_OUTPUT_DIR} -type f -exec sed -i'orig' 's/<!-- Generated by javadoc [^>]* -->//' {} "\;"
COMMAND find ${SPHINX_GH_OUTPUT_DIR} -name '*orig' -delete
Expand Down
1 change: 1 addition & 0 deletions docs/api/java/java.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Building cvc5 Java API
* enum `Kind <io/github/cvc5/Kind.html>`_
* enum `Result.UnknownExplanation <io/github/cvc5/Result.UnknownExplanation.html>`_
* enum `RoundingMode <io/github/cvc5/RoundingMode.html>`_
* enum `ProofRule <io/github/cvc5/ProofRule.html>`_
* exception `CVC5ApiException <io/github/cvc5/CVC5ApiException.html>`_
* exception `CVC5ApiOptionException <io/github/cvc5/CVC5ApiOptionException.html>`_
* exception `CVC5ApiRecoverableException <io/github/cvc5/CVC5ApiRecoverableException.html>`_
6 changes: 6 additions & 0 deletions docs/api/python/base/proofrule.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ProofRule
=========

.. autoclass:: cvc5.ProofRule
:members:
:undoc-members:
2 changes: 1 addition & 1 deletion docs/proofs/proof_rules.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Proof rules
===========

.. doxygenenum:: cvc5::internal::PfRule
.. doxygenenum:: cvc5::ProofRule
:project: cvc5
1 change: 1 addition & 0 deletions include/cvc5/cvc5.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <cvc5/cvc5_kind.h>
#include <cvc5/cvc5_types.h>
#include <cvc5/cvc5_proof_rule.h>

#include <functional>
#include <map>
Expand Down
Loading

0 comments on commit 0a35879

Please sign in to comment.