1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds, Tim King |
4 |
|
* |
5 |
|
* This file is part of the cvc5 project. |
6 |
|
* |
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. |
11 |
|
* **************************************************************************** |
12 |
|
* |
13 |
|
* Enumerator for uninterpreted sorts and functions. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "theory/builtin/type_enumerator.h" |
17 |
|
|
18 |
|
#include "theory/builtin/theory_builtin_rewriter.h" |
19 |
|
|
20 |
|
namespace cvc5 { |
21 |
|
namespace theory { |
22 |
|
namespace builtin { |
23 |
|
|
24 |
|
FunctionEnumerator::FunctionEnumerator(TypeNode type, |
25 |
|
TypeEnumeratorProperties* tep) |
26 |
|
: TypeEnumeratorBase<FunctionEnumerator>(type), |
27 |
|
d_arrayEnum(TheoryBuiltinRewriter::getArrayTypeForFunctionType(type), tep) |
28 |
|
{ |
29 |
|
Assert(type.getKind() == kind::FUNCTION_TYPE); |
30 |
|
d_bvl = NodeManager::currentNM()->getBoundVarListForFunctionType(type); |
31 |
|
} |
32 |
|
|
33 |
|
Node FunctionEnumerator::operator*() |
34 |
|
{ |
35 |
|
if (isFinished()) |
36 |
|
{ |
37 |
|
throw NoMoreValuesException(getType()); |
38 |
|
} |
39 |
|
Node a = *d_arrayEnum; |
40 |
|
return TheoryBuiltinRewriter::getLambdaForArrayRepresentation(a, d_bvl); |
41 |
|
} |
42 |
|
|
43 |
|
FunctionEnumerator& FunctionEnumerator::operator++() |
44 |
|
{ |
45 |
|
++d_arrayEnum; |
46 |
|
return *this; |
47 |
|
} |
48 |
|
|
49 |
|
} // namespace builtin |
50 |
|
} // namespace theory |
51 |
29286 |
} // namespace cvc5 |