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 : : * The ExtRewPre preprocessing pass. 11 : : * 12 : : * Applies the extended rewriter to assertions. 13 : : */ 14 : : 15 : : #include "preprocessing/passes/extended_rewriter_pass.h" 16 : : 17 : : #include "options/smt_options.h" 18 : : #include "preprocessing/assertion_pipeline.h" 19 : : #include "preprocessing/preprocessing_pass_context.h" 20 : : #include "smt/env.h" 21 : : 22 : : namespace cvc5::internal { 23 : : namespace preprocessing { 24 : : namespace passes { 25 : : 26 : 50671 : ExtRewPre::ExtRewPre(PreprocessingPassContext* preprocContext) 27 : : : PreprocessingPass(preprocContext, "ext-rew-pre"), 28 : 152013 : d_id(options().smt.extRewPrep == options::ExtRewPrepMode::AGG 29 [ + + ]: 50671 : ? MethodId::RW_EXT_REWRITE_AGG 30 : : : MethodId::RW_EXT_REWRITE), 31 [ + + ]: 69831 : d_proof(options().smt.produceProofs 32 : 19160 : ? new RewriteProofGenerator(d_env, d_id) 33 : 50671 : : nullptr) 34 : : { 35 : 50671 : } 36 : : 37 : 40 : PreprocessingPassResult ExtRewPre::applyInternal( 38 : : AssertionPipeline* assertionsToPreprocess) 39 : : { 40 [ + + ]: 625 : for (unsigned i = 0, size = assertionsToPreprocess->size(); i < size; ++i) 41 : : { 42 : 599 : const Node& a = (*assertionsToPreprocess)[i]; 43 : 599 : Node ar = d_env.rewriteViaMethod(a, d_id); 44 [ + + ]: 599 : assertionsToPreprocess->replace(i, ar, d_proof.get()); 45 [ + + ]: 599 : if (assertionsToPreprocess->isInConflict()) 46 : : { 47 : 14 : return PreprocessingPassResult::CONFLICT; 48 : : } 49 [ + + ]: 599 : } 50 : 26 : return PreprocessingPassResult::NO_CONFLICT; 51 : : } 52 : : 53 : : 54 : : } // namespace passes 55 : : } // namespace preprocessing 56 : : } // namespace cvc5::internal