# kinds                                                               -*- sh -*-
#
# For documentation on this file format, please refer to
# src/theory/builtin/kinds.
#

theory THEORY_ARITH ::cvc5::internal::theory::arith::TheoryArith "theory/arith/theory_arith.h"
typechecker "theory/arith/theory_arith_type_rules.h"

properties stable-infinite
properties check propagate ppStaticLearn presolve notifyRestart

rewriter ::cvc5::internal::theory::arith::ArithRewriter "theory/arith/arith_rewriter.h"

operator ADD 2: "arithmetic addition (N-ary)"
operator MULT 2: "arithmetic multiplication (N-ary)"
operator NONLINEAR_MULT 2: "synonym for MULT"
operator SUB 2 "arithmetic binary subtraction operator"
operator NEG 1 "arithmetic unary negation"
operator DIVISION 2 "real division, division by 0 undefined (user symbol)"
operator DIVISION_TOTAL 2 "real division with interpreted division by 0 (internal symbol)"
operator INTS_DIVISION 2 "integer division, division by 0 undefined (user symbol)"
operator INTS_DIVISION_TOTAL 2 "integer division with interpreted division by 0 (internal symbol)"
operator INTS_MODULUS 2 "integer modulus, division by 0 undefined (user symbol)"
operator INTS_MODULUS_TOTAL 2 "integer modulus with interpreted division by 0 (internal symbol)"
operator ABS 1 "absolute value"
parameterized DIVISIBLE DIVISIBLE_OP 1 "divisibility-by-k predicate; first parameter is a DIVISIBLE_OP, second is integer term"
operator POW 2 "arithmetic power"
operator POW2 1 "arithmetic power of 2"

operator EXPONENTIAL 1 "exponential"
operator SINE 1 "sine"
operator COSINE 1 "consine"
operator TANGENT 1 "tangent"
operator COSECANT 1 "cosecant"
operator SECANT 1 "secant"
operator COTANGENT 1 "cotangent"
operator ARCSINE 1 "arc sine"
operator ARCCOSINE 1 "arc consine"
operator ARCTANGENT 1 "arc tangent"
operator ARCCOSECANT 1 "arc cosecant"
operator ARCSECANT 1 "arc secant"
operator ARCCOTANGENT 1 "arc cotangent"

operator SQRT 1 "square root"

constant DIVISIBLE_OP \
  struct \
  Divisible \
  ::cvc5::internal::DivisibleHashFunction \
  "util/divisible.h" \
  "operator for the divisibility-by-k predicate; payload is an instance of the cvc5::internal::Divisible class"

sort REAL_TYPE \
    Cardinality::REALS \
    well-founded \
        "NodeManager::currentNM()->mkConstReal(Rational(0))" \
        "expr/node_manager.h" \
    "real type"
sort INTEGER_TYPE \
    Cardinality::INTEGERS \
    well-founded \
        "NodeManager::currentNM()->mkConstInt(Rational(0))" \
        "expr/node_manager.h" \
    "integer type"

constant CONST_RATIONAL \
    class \
    Rational+ \
    ::cvc5::internal::RationalHashFunction \
    "util/rational.h" \
    "a multiple-precision rational constant; payload is an instance of the cvc5::internal::Rational class"

constant CONST_INTEGER \
    class \
    Rational+ \
    ::cvc5::internal::RationalHashFunction \
    "util/rational.h" \
    "a multiple-precision integer constant; payload is an instance of the cvc5::internal::Rational class"

constant REAL_ALGEBRAIC_NUMBER_OP \
    class \
    RealAlgebraicNumber+ \
    ::cvc5::internal::RealAlgebraicNumberHashFunction \
    "util/real_algebraic_number.h" \
    "a real algebraic number constant; payload is an instance of the cvc5::internal::RealAlgebraicNumber class"
parameterized REAL_ALGEBRAIC_NUMBER REAL_ALGEBRAIC_NUMBER_OP 0 "a real algebraic number constant; payload is an instance of the cvc5::internal::RealAlgebraicNumber class"

enumerator REAL_TYPE \
    "::cvc5::internal::theory::arith::RationalEnumerator" \
    "theory/arith/type_enumerator.h"
enumerator INTEGER_TYPE \
    "::cvc5::internal::theory::arith::IntegerEnumerator" \
    "theory/arith/type_enumerator.h"

operator LT 2 "less than, x < y"
operator LEQ 2 "less than or equal, x <= y"
operator GT 2 "greater than, x > y"
operator GEQ 2 "greater than or equal, x >= y"

# represents an indexed root predicate. See util/indexed_root_predicate.h for more documentation.
constant INDEXED_ROOT_PREDICATE_OP \
  struct \
  IndexedRootPredicate \
  ::cvc5::internal::IndexedRootPredicateHashFunction \
  "util/indexed_root_predicate.h" \
  "operator for the indexed root predicate; payload is an instance of the cvc5::internal::IndexedRootPredicate class"
parameterized INDEXED_ROOT_PREDICATE INDEXED_ROOT_PREDICATE_OP 2 "indexed root predicate; first parameter is a INDEXED_ROOT_PREDICATE_OP, second is a real variable compared to zero, third is a polynomial"

operator IS_INTEGER 1 "term-is-integer predicate (parameter is a real-sorted term)"
operator TO_INTEGER 1 "convert term to integer by the floor function (parameter is a real-sorted term)"
operator TO_REAL 1 "cast term to real (parameter is an integer-sorted term)"

typerule ADD ::cvc5::internal::theory::arith::ArithOperatorTypeRule
typerule MULT ::cvc5::internal::theory::arith::ArithOperatorTypeRule
typerule NONLINEAR_MULT ::cvc5::internal::theory::arith::ArithOperatorTypeRule
typerule SUB ::cvc5::internal::theory::arith::ArithOperatorTypeRule
typerule NEG ::cvc5::internal::theory::arith::ArithOperatorTypeRule
typerule DIVISION ::cvc5::internal::theory::arith::ArithOperatorTypeRule
typerule POW ::cvc5::internal::theory::arith::ArithOperatorTypeRule

typerule CONST_RATIONAL ::cvc5::internal::theory::arith::ArithConstantTypeRule
typerule CONST_INTEGER ::cvc5::internal::theory::arith::ArithConstantTypeRule

typerule REAL_ALGEBRAIC_NUMBER_OP ::cvc5::internal::theory::arith::ArithRealAlgebraicNumberOpTypeRule
typerule REAL_ALGEBRAIC_NUMBER ::cvc5::internal::theory::arith::ArithRealAlgebraicNumberTypeRule

typerule LT ::cvc5::internal::theory::arith::ArithRelationTypeRule
typerule LEQ ::cvc5::internal::theory::arith::ArithRelationTypeRule
typerule GT ::cvc5::internal::theory::arith::ArithRelationTypeRule
typerule GEQ ::cvc5::internal::theory::arith::ArithRelationTypeRule

typerule INDEXED_ROOT_PREDICATE_OP "SimpleTypeRule<RBuiltinOperator>"
typerule INDEXED_ROOT_PREDICATE ::cvc5::internal::theory::arith::IndexedRootPredicateTypeRule

typerule TO_REAL "SimpleTypeRule<RReal, ARealOrInteger>"
typerule TO_INTEGER "SimpleTypeRule<RInteger, ARealOrInteger>"
typerule IS_INTEGER "SimpleTypeRule<RBool, ARealOrInteger>"

typerule ABS ::cvc5::internal::theory::arith::ArithOperatorTypeRule
typerule INTS_DIVISION "SimpleTypeRule<RInteger, AInteger, AInteger>"
typerule INTS_MODULUS "SimpleTypeRule<RInteger, AInteger, AInteger>"
typerule DIVISIBLE "SimpleTypeRule<RBool, AInteger>"
typerule DIVISIBLE_OP "SimpleTypeRule<RBuiltinOperator>"

typerule DIVISION_TOTAL ::cvc5::internal::theory::arith::ArithOperatorTypeRule
typerule INTS_DIVISION_TOTAL "SimpleTypeRule<RInteger, AInteger, AInteger>"
typerule INTS_MODULUS_TOTAL "SimpleTypeRule<RInteger, AInteger, AInteger>"

typerule EXPONENTIAL "SimpleTypeRule<RReal, ARealOrInteger>"
typerule SINE "SimpleTypeRule<RReal, ARealOrInteger>"
typerule COSINE "SimpleTypeRule<RReal, ARealOrInteger>"
typerule TANGENT "SimpleTypeRule<RReal, ARealOrInteger>"
typerule COSECANT "SimpleTypeRule<RReal, ARealOrInteger>"
typerule SECANT "SimpleTypeRule<RReal, ARealOrInteger>"
typerule COTANGENT "SimpleTypeRule<RReal, ARealOrInteger>"
typerule ARCSINE "SimpleTypeRule<RReal, ARealOrInteger>"
typerule ARCCOSINE "SimpleTypeRule<RReal, ARealOrInteger>"
typerule ARCTANGENT "SimpleTypeRule<RReal, ARealOrInteger>"
typerule ARCCOSECANT "SimpleTypeRule<RReal, ARealOrInteger>"
typerule ARCSECANT "SimpleTypeRule<RReal, ARealOrInteger>"
typerule ARCCOTANGENT "SimpleTypeRule<RReal, ARealOrInteger>"
typerule POW2 "SimpleTypeRule<RInteger, AInteger>"

typerule SQRT "SimpleTypeRule<RReal, ARealOrInteger>"

nullaryoperator PI "pi"

typerule PI ::cvc5::internal::theory::arith::RealNullaryOperatorTypeRule

# Integer AND, which is parameterized by a (positive) bitwidth k.
# ((_ iand k) i1 i2) is equivalent to:
# (bv2int (bvand ((_ int2bv k) i1) ((_ int2bv k) i2)))
# for all integers i1, i2.
constant IAND_OP \
  struct \
  IntAnd \
  "::cvc5::internal::UnsignedHashFunction< ::cvc5::internal::IntAnd >" \
  "util/iand.h" \
  "operator for integer AND; payload is an instance of the cvc5::internal::IntAnd class"
parameterized IAND IAND_OP 2 "integer version of AND operator; first parameter is an IAND_OP, second and third are integer terms"

typerule IAND_OP "SimpleTypeRule<RBuiltinOperator>"
typerule IAND ::cvc5::internal::theory::arith::IAndTypeRule

endtheory
