Branch data Line data Source code
1 : : /****************************************************************************** 2 : : * This file is part of the cvc5 project. 3 : : * 4 : : * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS 5 : : * in the top-level source directory and their institutional affiliations. 6 : : * All rights reserved. See the file COPYING in the top-level source 7 : : * directory for licensing information. 8 : : * **************************************************************************** 9 : : * 10 : : * Internal skolem identifiers 11 : : */ 12 : : 13 : : #include "cvc5_private.h" 14 : : 15 : : #ifndef CVC5__EXPR__INTERNAL_SKOLEM_ID_H 16 : : #define CVC5__EXPR__INTERNAL_SKOLEM_ID_H 17 : : 18 : : #include <string> 19 : : 20 : : namespace cvc5::internal { 21 : : 22 : : /** 23 : : * Internal skolem function identifier, used for identifying internal skolems 24 : : * that are not exported as part of the API. 25 : : * 26 : : * This is a subclassification of skolems whose SkolemId is INTERNAL. It is 27 : : * used to generate canonical skolems but without exporting to the API. Skolems 28 : : * can be created using mkInternalSkolemFunction below. 29 : : */ 30 : : enum class InternalSkolemId 31 : : { 32 : : NONE, 33 : : /** Sequence model construction, element for base */ 34 : : SEQ_MODEL_BASE_ELEMENT, 35 : : /** the "none" term, for instantiation evaluation */ 36 : : IEVAL_NONE, 37 : : /** the "some" term, for instantiation evaluation */ 38 : : IEVAL_SOME, 39 : : /** sygus "any constant" placeholder */ 40 : : SYGUS_ANY_CONSTANT, 41 : : /** 42 : : * Quantifiers synth fun embedding, for function-to-synthesize, this the 43 : : * first order datatype variable for f. 44 : : */ 45 : : QUANTIFIERS_SYNTH_FUN_EMBED, 46 : : /** Higher-order type match predicate, see HoTermDb */ 47 : : HO_TYPE_MATCH_PRED, 48 : : /** Input variables for MBQI */ 49 : : MBQI_INPUT, 50 : : /** Choice functions for mbqi-enum */ 51 : : MBQI_CHOICE_FUN, 52 : : /** abstract value for a term t */ 53 : : ABSTRACT_VALUE, 54 : : /** Input variables for quantifier elimination of closed formulas */ 55 : : QE_CLOSED_INPUT, 56 : : /** Skolem used for marking a quantified attribute */ 57 : : QUANTIFIERS_ATTRIBUTE_INTERNAL, 58 : : /** Skolem used for subsolver in get-value */ 59 : : GET_VALUE_PURIFY, 60 : : /** Input variables for normalizing inputs */ 61 : : NORMALIZE_INPUT_VARIABLE 62 : : }; 63 : : /** Converts an internal skolem function name to a string. */ 64 : : const char* toString(InternalSkolemId id); 65 : : /** Writes an internal skolem function name to a stream. */ 66 : : std::ostream& operator<<(std::ostream& out, InternalSkolemId id); 67 : : 68 : : /** 69 : : * Optional flags used to control behavior of skolem creation. 70 : : * They should be composed with bitwise operators. 71 : : */ 72 : : enum class SkolemFlags : uint8_t 73 : : { 74 : : /** default behavior */ 75 : : SKOLEM_DEFAULT = 0, 76 : : /** do not make the name unique by adding the id */ 77 : : SKOLEM_EXACT_NAME = 1, 78 : : }; 79 : : 80 : : /* 81 : : * Performs a bitwise OR operation between two SkolemFlags values. 82 : : */ 83 : : inline SkolemFlags operator|(SkolemFlags lhs, SkolemFlags rhs) 84 : : { 85 : : return static_cast<SkolemFlags>( 86 : : static_cast<std::underlying_type_t<SkolemFlags>>(lhs) 87 : : | static_cast<std::underlying_type_t<SkolemFlags>>(rhs)); 88 : : } 89 : : 90 : : /* 91 : : * Performs a bitwise AND operation between two SkolemFlags values. 92 : : */ 93 : 707599 : inline SkolemFlags operator&(SkolemFlags lhs, SkolemFlags rhs) 94 : : { 95 : : return static_cast<SkolemFlags>( 96 : : static_cast<std::underlying_type_t<SkolemFlags>>(lhs) 97 : 707599 : & static_cast<std::underlying_type_t<SkolemFlags>>(rhs)); 98 : : } 99 : : 100 : : } // namespace cvc5::internal 101 : : 102 : : #endif /* CVC5__EXPR__INTERNAL_SKOLEM_ID_H */