-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ff: hook up SplitGB solver (cvc5#10274)
- Loading branch information
1 parent
62a9a00
commit 47643db
Showing
18 changed files
with
276 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/****************************************************************************** | ||
* Top contributors (to current version): | ||
* Alex Ozdemir | ||
* | ||
* This file is part of the cvc5 project. | ||
* | ||
* Copyright (c) 2009-2023 by the authors listed in the file AUTHORS | ||
* in the top-level source directory and their institutional affiliations. | ||
* All rights reserved. See the file COPYING in the top-level source | ||
* directory for licensing information. | ||
* **************************************************************************** | ||
* | ||
* replace disjunctive bit constraints with polynomial bit constraints | ||
* | ||
* example: x = 0 OR x = 1 becomes x * x = x | ||
*/ | ||
|
||
#include "preprocessing/passes/ff_disjunctive_bit.h" | ||
|
||
// external includes | ||
|
||
// std includes | ||
|
||
// internal includes | ||
#include "preprocessing/assertion_pipeline.h" | ||
#include "theory/ff/parse.h" | ||
|
||
namespace cvc5::internal { | ||
namespace preprocessing { | ||
namespace passes { | ||
|
||
FfDisjunctiveBit::FfDisjunctiveBit(PreprocessingPassContext* preprocContext) | ||
: PreprocessingPass(preprocContext, "ff-disjunctive-bit") | ||
{ | ||
} | ||
|
||
PreprocessingPassResult FfDisjunctiveBit::applyInternal( | ||
AssertionPipeline* assertionsToPreprocess) | ||
{ | ||
auto nm = NodeManager::currentNM(); | ||
for (uint64_t i = 0, n = assertionsToPreprocess->size(); i < n; ++i) | ||
{ | ||
Node fact = (*assertionsToPreprocess)[i]; | ||
std::optional<Node> var = theory::ff::parse::disjunctiveBitConstraint(fact); | ||
if (var.has_value()) | ||
{ | ||
Trace("ff::disjunctive-bit") << "rw bit constr: " << *var << std::endl; | ||
Node var2 = nm->mkNode(Kind::FINITE_FIELD_MULT, *var, *var); | ||
assertionsToPreprocess->replace(i, var2.eqNode(*var)); | ||
} | ||
} | ||
return PreprocessingPassResult::NO_CONFLICT; | ||
} | ||
|
||
} // namespace passes | ||
} // namespace preprocessing | ||
} // namespace cvc5::internal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/****************************************************************************** | ||
* Top contributors (to current version): | ||
* Alex Ozdemir | ||
* | ||
* This file is part of the cvc5 project. | ||
* | ||
* Copyright (c) 2009-2023 by the authors listed in the file AUTHORS | ||
* in the top-level source directory and their institutional affiliations. | ||
* All rights reserved. See the file COPYING in the top-level source | ||
* directory for licensing information. | ||
* **************************************************************************** | ||
* | ||
* replace disjunctive bit constraints with polynomial bit constraints | ||
* | ||
* example: x = 0 OR x = 1 becomes x * x = x | ||
*/ | ||
|
||
#include "cvc5_private.h" | ||
|
||
#ifndef CVC5__PREPROCESSING__PASSES__FF_DISJUNCTIVE_BIT_H | ||
#define CVC5__PREPROCESSING__PASSES__FF_DISJUNCTIVE_BIT_H | ||
|
||
// external includes | ||
|
||
// std includes | ||
|
||
// internal includes | ||
#include "preprocessing/preprocessing_pass.h" | ||
#include "preprocessing/preprocessing_pass_context.h" | ||
|
||
namespace cvc5::internal { | ||
namespace preprocessing { | ||
namespace passes { | ||
|
||
class FfDisjunctiveBit : public PreprocessingPass | ||
{ | ||
public: | ||
FfDisjunctiveBit(PreprocessingPassContext* preprocContext); | ||
|
||
protected: | ||
PreprocessingPassResult applyInternal( | ||
AssertionPipeline* assertionsToPreprocess) override; | ||
}; | ||
|
||
} // namespace passes | ||
} // namespace preprocessing | ||
} // namespace cvc5::internal | ||
|
||
#endif /* CVC5__PREPROCESSING__PASSES__FF_DISJUNCTIVE_BIT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.