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 : : * Arrays inference manager. 11 : : */ 12 : : 13 : : #include "cvc5_private.h" 14 : : 15 : : #ifndef CVC5__THEORY__ARRAYS__INFERENCE_MANAGER_H 16 : : #define CVC5__THEORY__ARRAYS__INFERENCE_MANAGER_H 17 : : 18 : : #include "cvc5/cvc5_proof_rule.h" 19 : : #include "expr/node.h" 20 : : #include "proof/eager_proof_generator.h" 21 : : #include "theory/theory_inference_manager.h" 22 : : 23 : : namespace cvc5::internal { 24 : : namespace theory { 25 : : namespace arrays { 26 : : 27 : : /** 28 : : * The arrays inference manager. 29 : : */ 30 : : class InferenceManager : public TheoryInferenceManager 31 : : { 32 : : public: 33 : : InferenceManager(Env& env, Theory& t, TheoryState& state); 34 : 28686 : ~InferenceManager() {} 35 : : 36 : : /** 37 : : * Assert inference. This sends an internal fact to the equality engine 38 : : * immediately, possibly with proof support. The identifier id which 39 : : * rule to apply when proofs are enabled. The order of children 40 : : * and arguments to use in the proof step are determined internally in 41 : : * this method. 42 : : * 43 : : * @return true if the fact was successfully asserted, and false if the 44 : : * fact was redundant. 45 : : */ 46 : : bool assertInference( 47 : : TNode atom, bool polarity, InferenceId id, TNode reason, ProofRule pfr); 48 : : /** 49 : : * Send lemma (exp => conc) based on proof rule id with properties p. 50 : : */ 51 : : bool arrayLemma(Node conc, 52 : : InferenceId id, 53 : : Node exp, 54 : : ProofRule pfr, 55 : : LemmaProperty p = LemmaProperty::NONE); 56 : : 57 : : private: 58 : : /** 59 : : * Converts a conclusion, explanation and proof rule id used by the array 60 : : * theory to the set of arguments required for a proof rule application. 61 : : */ 62 : : void convert(ProofRule& id, 63 : : Node conc, 64 : : Node exp, 65 : : std::vector<Node>& children, 66 : : std::vector<Node>& args); 67 : : /** Eager proof generator for lemmas from the above method */ 68 : : std::unique_ptr<EagerProofGenerator> d_lemmaPg; 69 : : }; 70 : : 71 : : } // namespace arrays 72 : : } // namespace theory 73 : : } // namespace cvc5::internal 74 : : 75 : : #endif