1 /********************* */
2 /*! \file nl_lemma_utils.cpp
4 ** Top contributors (to current version):
5 ** Andrew Reynolds, Gereon Kremer
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2021 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.\endverbatim
12 ** \brief Implementation of utilities for the non-linear solver
15 #include "theory/arith/nl/nl_lemma_utils.h"
17 #include "theory/arith/nl/nl_model.h"
18 #include "theory/arith/nl/nonlinear_extension.h"
25 TrustNode
NlLemma::processLemma(LemmaProperty
& p
)
27 if (d_nlext
!= nullptr)
29 d_nlext
->processSideEffect(*this);
31 return SimpleTheoryLemma::processLemma(p
);
34 std::ostream
& operator<<(std::ostream
& out
, NlLemma
& n
)
40 bool SortNlModel::operator()(Node i
, Node j
)
42 int cv
= d_nlm
->compare(i
, j
, d_isConcrete
, d_isAbsolute
);
47 return d_reverse_order
? cv
< 0 : cv
> 0;
50 bool SortNonlinearDegree::operator()(Node i
, Node j
)
52 unsigned i_count
= getDegree(i
);
53 unsigned j_count
= getDegree(j
);
54 return i_count
== j_count
? (i
< j
) : (i_count
< j_count
? true : false);
57 unsigned SortNonlinearDegree::getDegree(Node n
) const
59 std::map
<Node
, unsigned>::const_iterator it
= d_mdegree
.find(n
);
60 Assert(it
!= d_mdegree
.end());
64 Node
ArgTrie::add(Node d
, const std::vector
<Node
>& args
)
67 for (const Node
& a
: args
)
69 at
= &(at
->d_children
[a
]);
71 if (at
->d_data
.isNull())