-
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.
- Loading branch information
Showing
5 changed files
with
125 additions
and
1 deletion.
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
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,50 @@ | ||
/****************************************************************************** | ||
* Top contributors (to current version): | ||
* Andrew Reynolds | ||
* | ||
* This file is part of the cvc5 project. | ||
* | ||
* Copyright (c) 2009-2024 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. | ||
* **************************************************************************** | ||
* | ||
* Methods for elaborating MACRO_BV_* proof rewrites. | ||
*/ | ||
|
||
#include "theory/bv/macro_rewrite_elaborator.h" | ||
|
||
namespace cvc5::internal { | ||
namespace theory { | ||
namespace bv { | ||
|
||
MacroRewriteElaborator::MacroRewriteElaborator(Env& env) : EnvObj(env){} | ||
MacroRewriteElaborator::~MacroRewriteElaborator() {} | ||
bool MacroRewriteElaborator::ensureProofFor(CDProof* cdp, | ||
ProofRewriteRule id, | ||
const Node& eq) | ||
{ | ||
switch (id) | ||
{ | ||
case ProofRewriteRule::MACRO_BV_EXTRACT_CONCAT: | ||
case ProofRewriteRule::MACRO_BV_EXTRACT_SIGN_EXTEND: | ||
case ProofRewriteRule::MACRO_BV_ASHR_BY_CONST: | ||
case ProofRewriteRule::MACRO_BV_OR_SIMPLIFY: | ||
case ProofRewriteRule::MACRO_BV_AND_SIMPLIFY: | ||
case ProofRewriteRule::MACRO_BV_XOR_SIMPLIFY: | ||
case ProofRewriteRule::MACRO_BV_AND_OR_XOR_CONCAT_PULLUP: | ||
case ProofRewriteRule::MACRO_BV_MULT_SLT_MULT: | ||
case ProofRewriteRule::MACRO_BV_CONCAT_EXTRACT_MERGE: | ||
case ProofRewriteRule::MACRO_BV_CONCAT_CONSTANT_MERGE: | ||
case ProofRewriteRule::MACRO_BV_FLATTEN_ASSOC_COMMUT: | ||
break; | ||
default: | ||
break; | ||
} | ||
return false; | ||
} | ||
|
||
} // namespace bv | ||
} // namespace theory | ||
} // 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,55 @@ | ||
/****************************************************************************** | ||
* Top contributors (to current version): | ||
* Andrew Reynolds | ||
* | ||
* This file is part of the cvc5 project. | ||
* | ||
* Copyright (c) 2009-2024 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. | ||
* **************************************************************************** | ||
* | ||
* Methods for elaborating MACRO_BV_* proof rewrites. | ||
*/ | ||
|
||
#include "cvc5_private.h" | ||
|
||
#ifndef CVC5__THEORY__BV__MACRO_REWRITE_ELABORATOR_H | ||
#define CVC5__THEORY__BV__MACRO_REWRITE_ELABORATOR_H | ||
|
||
#include "proof/proof.h" | ||
#include "smt/env_obj.h" | ||
|
||
namespace cvc5::internal { | ||
namespace theory { | ||
namespace bv { | ||
|
||
/** | ||
* Methods for elaborating MACRO_BV_* proof rewrites. This class is called during | ||
* RARE proof reconstruction. | ||
*/ | ||
class MacroRewriteElaborator : protected EnvObj | ||
{ | ||
public: | ||
/** Constructor */ | ||
MacroRewriteElaborator(Env& env); | ||
~MacroRewriteElaborator(); | ||
/** | ||
* Elaborate a rewrite eq that was proven by a macro rewrite rule. | ||
* | ||
* @param cdp The proof to add to. | ||
* @param id The (macro) rewrite id that proved the rewrite. | ||
* @param eq The rewrite proven. | ||
* @return true if added a closed proof of eq to cdp. | ||
*/ | ||
bool ensureProofFor(CDProof* cdp, | ||
ProofRewriteRule id, | ||
const Node& eq); | ||
}; | ||
|
||
} // namespace bv | ||
} // namespace theory | ||
} // namespace cvc5::internal | ||
|
||
#endif /* CVC5__THEORY__BV__MACRO_REWRITE_ELABORATOR_H */ |