LCOV - code coverage report
Current view: top level - buildbot/coverage/build/src/theory/fp - fp_expand_defs.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 1 100.0 %
Date: 2024-12-09 12:41:16 Functions: 1 1 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /******************************************************************************
       2                 :            :  * Top contributors (to current version):
       3                 :            :  *   Andrew Reynolds, Martin Brain, Aina Niemetz
       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                 :            :  * Expand definitions for floating-point arithmetic.
      14                 :            :  */
      15                 :            : 
      16                 :            : #include "cvc5_private.h"
      17                 :            : 
      18                 :            : #ifndef CVC5__THEORY__FP__FP_EXPAND_DEFS_H
      19                 :            : #define CVC5__THEORY__FP__FP_EXPAND_DEFS_H
      20                 :            : 
      21                 :            : #include "context/cdhashmap.h"
      22                 :            : #include "expr/node.h"
      23                 :            : #include "proof/trust_node.h"
      24                 :            : 
      25                 :            : namespace cvc5::internal {
      26                 :            : namespace theory {
      27                 :            : namespace fp {
      28                 :            : 
      29                 :            : /**
      30                 :            :  * Module responsibile for expanding definitions for the FP theory.
      31                 :            :  */
      32                 :            : class FpExpandDefs
      33                 :            : {
      34                 :            :   using PairTypeNodeHashFunction = PairHashFunction<TypeNode,
      35                 :            :                                                     TypeNode,
      36                 :            :                                                     std::hash<TypeNode>,
      37                 :            :                                                     std::hash<TypeNode>>;
      38                 :            :   /** Uninterpreted functions for undefined cases of non-total operators. */
      39                 :            :   using ComparisonUFMap = context::CDHashMap<TypeNode, Node>;
      40                 :            :   /** Uninterpreted functions for lazy handling of conversions. */
      41                 :            :   using ConversionUFMap = context::
      42                 :            :       CDHashMap<std::pair<TypeNode, TypeNode>, Node, PairTypeNodeHashFunction>;
      43                 :            : 
      44                 :            :  public:
      45                 :      49895 :   FpExpandDefs(NodeManager* nm) : d_nm(nm) {}
      46                 :            :   /** expand definitions in node */
      47                 :            :   Node expandDefinition(Node node);
      48                 :            : 
      49                 :            :  private:
      50                 :            :   /**
      51                 :            :    * Helper to create a function application on a fresh UF for the undefined
      52                 :            :    * zero case of fp.min/fp.max. The UF is instantiated with the operands of
      53                 :            :    * the given node.
      54                 :            :    * @param node The fp.min/fp.maxnode to create the UF and its application for.
      55                 :            :    * @return The function application.
      56                 :            :    */
      57                 :            :   Node minMaxUF(TNode node);
      58                 :            :   /**
      59                 :            :    * Helper to create a function application on a fresh UF for the undefined
      60                 :            :    * cases of fp.to_ubv/fp.to_sbv. The UF is instantiated with the operands of
      61                 :            :    * the given node.
      62                 :            :    * @param node The fp.to_sbv/to_ubv node to create the UF and its application
      63                 :            :    *             for.
      64                 :            :    * @return The function application.
      65                 :            :    */
      66                 :            :   Node toUbvSbvUF(TNode node);
      67                 :            :   /**
      68                 :            :    * Helper to create a function application on a fresh UF for the undefined
      69                 :            :    * cases of fp.to_real. The UF is instantiated with the operands of the given
      70                 :            :    * fp.to_real node.
      71                 :            :    * @param node The fp.to_real node to create the UF and its application for.
      72                 :            :    * @return The function application.
      73                 :            :    */
      74                 :            :   Node toRealUF(TNode node);
      75                 :            :   /** The associated node manager. */
      76                 :            :   NodeManager* d_nm;
      77                 :            : }; /* class TheoryFp */
      78                 :            : 
      79                 :            : }  // namespace fp
      80                 :            : }  // namespace theory
      81                 :            : }  // namespace cvc5::internal
      82                 :            : 
      83                 :            : #endif /* CVC5__THEORY__FP__FP_EXPAND_DEFS_H */

Generated by: LCOV version 1.14