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 preprocessing pass super class. 11 : : */ 12 : : 13 : : #include "preprocessing/preprocessing_pass.h" 14 : : 15 : : #include <unordered_map> 16 : : 17 : : #include "preprocessing/assertion_pipeline.h" 18 : : #include "preprocessing/preprocessing_pass_context.h" 19 : : #include "printer/printer.h" 20 : : #include "smt/env.h" 21 : : #include "theory/trust_substitutions.h" 22 : : #include "util/statistics_stats.h" 23 : : 24 : : namespace cvc5::internal { 25 : : namespace preprocessing { 26 : : 27 : 348282 : PreprocessingPassResult PreprocessingPass::apply( 28 : : AssertionPipeline* assertionsToPreprocess) 29 : : { 30 : 348282 : TimerStat::CodeTimer codeTimer(d_timer); 31 [ + - ]: 348282 : Trace("preprocessing") << "PRE " << d_name << std::endl; 32 : 348282 : verbose(2) << d_name << "..." << std::endl; 33 : 348282 : PreprocessingPassResult result = applyInternal(assertionsToPreprocess); 34 [ + - ]: 348261 : Trace("preprocessing") << "POST " << d_name << std::endl; 35 : 348261 : return result; 36 : 348282 : } 37 : : 38 : 38181 : void PreprocessingPass::addSubstitutions( 39 : : AssertionPipeline* assertionsToPreprocess, theory::TrustSubstitutionMap& tm) 40 : : { 41 : 38181 : const std::unordered_map<Node, Node> subs = tm.get().getSubstitutions(); 42 [ + + ]: 90822 : for (const std::pair<const Node, Node>& s : subs) 43 : : { 44 [ + + ]: 52641 : if (s.first.getKind() == Kind::SKOLEM) 45 : : { 46 : 473 : assertionsToPreprocess->removeIteSkolem(s.first); 47 : : } 48 : : } 49 : 38181 : d_preprocContext->addSubstitutions(tm); 50 : 38181 : } 51 : : 52 : 1873985 : PreprocessingPass::PreprocessingPass(PreprocessingPassContext* preprocContext, 53 : 1873985 : const std::string& name) 54 : : : EnvObj(preprocContext->getEnv()), 55 : 1873985 : d_preprocContext(preprocContext), 56 : 1873985 : d_name(name), 57 : 1873985 : d_timer(statisticsRegistry().registerTimer("preprocessing::" + name)) 58 : : { 59 : 1873985 : } 60 : : 61 : 1861457 : PreprocessingPass::~PreprocessingPass() {} 62 : : 63 : : } // namespace preprocessing 64 : : } // namespace cvc5::internal