LCOV - code coverage report
Current view: top level - buildbot/coverage/build/test/api/cpp/issues - proj-issue388.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 36 37 97.3 %
Date: 2026-04-01 10:41:05 Functions: 1 1 100.0 %
Branches: 1 2 50.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                 :            :  * Test for project issue #388
      11                 :            :  *
      12                 :            :  */
      13                 :            : 
      14                 :            : #include <cvc5/cvc5.h>
      15                 :            : 
      16                 :            : #include <cassert>
      17                 :            : 
      18                 :            : #include "base/configuration.h"
      19                 :            : 
      20                 :            : using namespace cvc5;
      21                 :            : 
      22                 :          1 : int main(void)
      23                 :            : {
      24         [ -  + ]:          1 :   if (!internal::Configuration::isBuiltWithPoly())
      25                 :            :   {
      26                 :          0 :     return 0;
      27                 :            :   }
      28                 :            :   {  // Original
      29                 :          1 :     TermManager tm;
      30                 :          1 :     Solver slv(tm);
      31                 :          1 :     slv.setLogic("QF_NRA");
      32                 :          1 :     Sort s = tm.getRealSort();
      33                 :          1 :     Term t1 = tm.mkConst(s, "a");
      34                 :          1 :     Term t2 = tm.mkConst(s, "b");
      35                 :          1 :     Term t3 = tm.mkConst(s, "c");
      36                 :          4 :     Term t4 = tm.mkTerm(Kind::DIVISION, {t1, t2});
      37                 :          4 :     Term t5 = tm.mkTerm(Kind::GT, {t4, t3});
      38                 :          4 :     Term t6 = tm.mkTerm(Kind::DIVISION, {t1, t3});
      39                 :          3 :     Term t7 = tm.mkTerm(Kind::IS_INTEGER, {t6});
      40                 :          5 :     Term t8 = tm.mkTerm(Kind::AND, {t5, t7, t5});
      41                 :          3 :     Term t9 = tm.mkTerm(Kind::NOT, {t8});
      42                 :          1 :     slv.assertFormula(t9);
      43                 :          1 :     slv.checkSat();
      44                 :          1 :   }
      45                 :            :   {  // Minimized
      46                 :          1 :     TermManager tm;
      47                 :          1 :     Solver slv(tm);
      48                 :          1 :     slv.setOption("nl-cov", "true");
      49                 :          1 :     slv.setOption("nl-cov-var-elim", "true");
      50                 :          1 :     slv.setOption("nl-ext", "none");
      51                 :          1 :     slv.setLogic("QF_NIRA");
      52                 :          1 :     Sort s = tm.getRealSort();
      53                 :          1 :     Term t1 = tm.mkConst(s, "a");
      54                 :          1 :     Term t2 = tm.mkConst(s, "b");
      55                 :          1 :     Term t3 = tm.mkReal(0);
      56                 :          3 :     Term t7 = tm.mkTerm(Kind::IS_INTEGER, {t1});
      57                 :          4 :     Term t4 = tm.mkTerm(Kind::DIVISION, {t2, t1});
      58                 :          4 :     Term t5 = tm.mkTerm(Kind::DISTINCT, {t3, t4});
      59                 :          4 :     Term t8 = tm.mkTerm(Kind::OR, {t7, t5});
      60                 :          1 :     slv.assertFormula(t8);
      61                 :          1 :     slv.checkSat();
      62                 :          1 :   }
      63                 :          1 : }

Generated by: LCOV version 1.14