LCOV - code coverage report
Current view: top level - buildbot/coverage/build/test/api/cpp/issues - proj-issue445.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 20 21 95.2 %
Date: 2024-09-24 10:47:28 Functions: 1 1 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /******************************************************************************
       2                 :            :  * Top contributors (to current version):
       3                 :            :  *   Aina Niemetz, Andrew Reynolds, Andres Noetzli
       4                 :            :  *
       5                 :            :  * This file is part of the cvc5 project.
       6                 :            :  *
       7                 :            :  * Copyright (c) 2009-2024 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                 :            :  * Test for project issue #445
      14                 :            :  *
      15                 :            :  */
      16                 :            : 
      17                 :            : #include <cvc5/cvc5.h>
      18                 :            : 
      19                 :            : #include <cassert>
      20                 :            : 
      21                 :            : using namespace cvc5;
      22                 :            : 
      23                 :          1 : int main(void)
      24                 :            : {
      25                 :          2 :   TermManager tm;
      26                 :          2 :   Solver slv(tm);
      27                 :          1 :   slv.setOption("strings-exp", "true");
      28                 :          1 :   slv.setOption("sygus-abort-size", "1");
      29                 :          2 :   Sort s1 = tm.mkUninterpretedSort("_u0");
      30                 :          2 :   Sort s5 = tm.mkUninterpretedSort("_u1");
      31                 :          2 :   Sort s6 = tm.mkUninterpretedSort("_u2");
      32                 :          4 :   Sort s7 = tm.mkFunctionSort({s1}, s6);
      33                 :          2 :   Term t7 = tm.mkConst(s7, "_x8");
      34                 :          2 :   Term t13 = tm.mkConst(s5, "_x14");
      35                 :          4 :   Term t15 = tm.mkTerm(Kind::SEQ_UNIT, {t13});
      36                 :          4 :   Term t84 = tm.mkTerm(Kind::SEQ_REV, {t15});
      37                 :          4 :   Term t141 = tm.mkTerm(Kind::SEQ_UNIT, {t84});
      38                 :          4 :   Term t229 = tm.mkTerm(Kind::SEQ_UNIT, {t15});
      39                 :          6 :   Term t279 = tm.mkTerm(Kind::SEQ_REPLACE_ALL, {t141, t229, t141});
      40                 :          5 :   Term t289 = tm.mkTerm(Kind::SEQ_PREFIX, {t279, t229});
      41                 :          1 :   slv.assertFormula({t289});
      42                 :            :   // should terminate with an exception indicating we are done enumerating
      43                 :            :   // rewrite rules.
      44                 :            :   try
      45                 :            :   {
      46                 :          1 :     (void)slv.simplify(t7);
      47                 :            :   }
      48                 :          0 :   catch (cvc5::CVC5ApiException& e)
      49                 :            :   {
      50                 :            :   }
      51                 :          1 : }

Generated by: LCOV version 1.14