LCOV - code coverage report
Current view: top level - buildbot/coverage/build/src/preprocessing/passes - rewrite.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 12 13 92.3 %
Date: 2026-04-07 10:40:57 Functions: 2 2 100.0 %
Branches: 8 10 80.0 %

           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 rewrite preprocessing pass.
      11                 :            :  *
      12                 :            :  * Calls the rewriter on every assertion.
      13                 :            :  */
      14                 :            : 
      15                 :            : #include "preprocessing/passes/rewrite.h"
      16                 :            : 
      17                 :            : #include "options/smt_options.h"
      18                 :            : #include "preprocessing/assertion_pipeline.h"
      19                 :            : #include "theory/rewriter.h"
      20                 :            : 
      21                 :            : namespace cvc5::internal {
      22                 :            : namespace preprocessing {
      23                 :            : namespace passes {
      24                 :            : 
      25                 :            : using namespace cvc5::internal::theory;
      26                 :            : 
      27                 :      51598 : Rewrite::Rewrite(PreprocessingPassContext* preprocContext)
      28                 :            :     : PreprocessingPass(preprocContext, "rewrite"),
      29         [ +  + ]:      51598 :       d_proof(options().smt.produceProofs ? new RewriteProofGenerator(d_env)
      30                 :      51598 :                                           : nullptr)
      31                 :            : {
      32                 :      51598 : }
      33                 :            : 
      34                 :      76511 : PreprocessingPassResult Rewrite::applyInternal(
      35                 :            :   AssertionPipeline* assertionsToPreprocess)
      36                 :            : {
      37         [ +  + ]:     989340 :   for (size_t i = 0, size = assertionsToPreprocess->size(); i < size; ++i)
      38                 :            :   {
      39                 :     912829 :     const Node& a = (*assertionsToPreprocess)[i];
      40                 :     912829 :     Node ar = rewrite(a);
      41         [ +  + ]:     912829 :     assertionsToPreprocess->replace(i, ar, d_proof.get());
      42         [ -  + ]:     912829 :     if (assertionsToPreprocess->isInConflict())
      43                 :            :     {
      44                 :          0 :       return PreprocessingPassResult::CONFLICT;
      45                 :            :     }
      46         [ +  - ]:     912829 :   }
      47                 :      76511 :   return PreprocessingPassResult::NO_CONFLICT;
      48                 :            : }
      49                 :            : 
      50                 :            : 
      51                 :            : }  // namespace passes
      52                 :            : }  // namespace preprocessing
      53                 :            : }  // namespace cvc5::internal

Generated by: LCOV version 1.14