LCOV - code coverage report
Current view: top level - buildbot/coverage/build/src/preprocessing/passes - extended_rewriter_pass.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 16 16 100.0 %
Date: 2026-02-22 11:44:16 Functions: 2 2 100.0 %
Branches: 12 12 100.0 %

           Branch data     Line data    Source code
       1                 :            : /******************************************************************************
       2                 :            :  * Top contributors (to current version):
       3                 :            :  *   Andrew Reynolds, Haniel Barbosa
       4                 :            :  *
       5                 :            :  * This file is part of the cvc5 project.
       6                 :            :  *
       7                 :            :  * Copyright (c) 2009-2025 by the authors listed in the file AUTHORS
       8                 :            :  * in the top-level source directory and their institutional affiliations.
       9                 :            :  * All rights reserved.  See the file COPYING in the top-level source
      10                 :            :  * directory for licensing information.
      11                 :            :  * ****************************************************************************
      12                 :            :  *
      13                 :            :  * The ExtRewPre preprocessing pass.
      14                 :            :  *
      15                 :            :  * Applies the extended rewriter to assertions.
      16                 :            :  */
      17                 :            : 
      18                 :            : #include "preprocessing/passes/extended_rewriter_pass.h"
      19                 :            : 
      20                 :            : #include "options/smt_options.h"
      21                 :            : #include "preprocessing/assertion_pipeline.h"
      22                 :            : #include "preprocessing/preprocessing_pass_context.h"
      23                 :            : #include "smt/env.h"
      24                 :            : 
      25                 :            : namespace cvc5::internal {
      26                 :            : namespace preprocessing {
      27                 :            : namespace passes {
      28                 :            : 
      29                 :      50592 : ExtRewPre::ExtRewPre(PreprocessingPassContext* preprocContext)
      30                 :            :     : PreprocessingPass(preprocContext, "ext-rew-pre"),
      31                 :     151776 :       d_id(options().smt.extRewPrep == options::ExtRewPrepMode::AGG
      32         [ +  + ]:      50592 :                ? MethodId::RW_EXT_REWRITE_AGG
      33                 :            :                : MethodId::RW_EXT_REWRITE),
      34         [ +  + ]:      69691 :       d_proof(options().smt.produceProofs
      35                 :      19099 :                   ? new RewriteProofGenerator(d_env, d_id)
      36                 :      50592 :                   : nullptr)
      37                 :            : {
      38                 :      50592 : }
      39                 :            : 
      40                 :         40 : PreprocessingPassResult ExtRewPre::applyInternal(
      41                 :            :     AssertionPipeline* assertionsToPreprocess)
      42                 :            : {
      43         [ +  + ]:        625 :   for (unsigned i = 0, size = assertionsToPreprocess->size(); i < size; ++i)
      44                 :            :   {
      45                 :        599 :     const Node& a = (*assertionsToPreprocess)[i];
      46                 :        599 :     Node ar = d_env.rewriteViaMethod(a, d_id);
      47         [ +  + ]:        599 :     assertionsToPreprocess->replace(i, ar, d_proof.get());
      48         [ +  + ]:        599 :     if (assertionsToPreprocess->isInConflict())
      49                 :            :     {
      50                 :         14 :       return PreprocessingPassResult::CONFLICT;
      51                 :            :     }
      52         [ +  + ]:        599 :   }
      53                 :         26 :   return PreprocessingPassResult::NO_CONFLICT;
      54                 :            : }
      55                 :            : 
      56                 :            : 
      57                 :            : }  // namespace passes
      58                 :            : }  // namespace preprocessing
      59                 :            : }  // namespace cvc5::internal

Generated by: LCOV version 1.14