LCOV - code coverage report
Current view: top level - buildbot/coverage/build/src/preprocessing - learned_literal_manager.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 18 19 94.7 %
Date: 2026-08-24 10:37:28 Functions: 3 3 100.0 %
Branches: 4 6 66.7 %

           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                 :            :  * Learned literal manager
      11                 :            :  */
      12                 :            : 
      13                 :            : #include "preprocessing/learned_literal_manager.h"
      14                 :            : 
      15                 :            : #include "smt/env.h"
      16                 :            : #include "theory/rewriter.h"
      17                 :            : #include "theory/trust_substitutions.h"
      18                 :            : 
      19                 :            : namespace cvc5::internal {
      20                 :            : namespace preprocessing {
      21                 :            : 
      22                 :      29012 : LearnedLiteralManager::LearnedLiteralManager(Env& env)
      23                 :      29012 :     : EnvObj(env), d_learnedLits(userContext())
      24                 :            : {
      25                 :      29012 : }
      26                 :            : 
      27                 :     155362 : void LearnedLiteralManager::notifyLearnedLiteral(TNode lit)
      28                 :            : {
      29                 :     155362 :   d_learnedLits.insert(lit);
      30         [ +  - ]:     155362 :   Trace("pp-llm") << "LLM:notifyLearnedLiteral: " << lit << std::endl;
      31                 :     155362 : }
      32                 :            : 
      33                 :         20 : std::vector<Node> LearnedLiteralManager::getLearnedLiterals() const
      34                 :            : {
      35                 :         20 :   theory::TrustSubstitutionMap& tls = d_env.getTopLevelSubstitutions();
      36                 :         20 :   std::vector<Node> currLearnedLits;
      37         [ +  + ]:         86 :   for (const auto& lit : d_learnedLits)
      38                 :            :   {
      39                 :            :     // update based on substitutions
      40                 :         66 :     Node tlsNode = tls.get().apply(lit);
      41                 :         66 :     tlsNode = rewrite(tlsNode);
      42                 :         66 :     currLearnedLits.push_back(tlsNode);
      43         [ +  - ]:        132 :     Trace("pp-llm") << "Learned literal : " << tlsNode << " from " << lit
      44                 :         66 :                     << std::endl;
      45                 :         66 :   }
      46                 :         20 :   return currLearnedLits;
      47                 :          0 : }
      48                 :            : 
      49                 :            : }  // namespace preprocessing
      50                 :            : }  // namespace cvc5::internal

Generated by: LCOV version 1.14