This repository was archived by the owner on Oct 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 184
first cut at providing synthesis with 'big components' from the LHS #326
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -206,8 +206,24 @@ class BaseSolver : public Solver { | |
| } | ||
|
|
||
| if (InferInsts && SMTSolver->supportsModels()) { | ||
| std::vector<Inst *> LHSComps; | ||
| findCands(LHS, LHSComps, IC, MaxNops); | ||
|
|
||
| std::vector<Inst *> Copies; | ||
| std::vector<InstMapping> PCsCopy; | ||
| BlockPCs BPCsCopy; | ||
| for (auto I : LHSComps) { | ||
| // separate sub-expressions by copying vars | ||
| std::map<Inst *, Inst *> InstCache; | ||
| std::map<Block *, Block *> BlockCache; | ||
| Copies.push_back(getInstCopy(I, IC, InstCache, BlockCache)); | ||
| separateBlockPCs(BPCs, BPCsCopy, InstCache, BlockCache, IC); | ||
| separatePCs(PCs, PCsCopy, InstCache, BlockCache, IC); | ||
| } | ||
|
|
||
| InstSynthesis IS; | ||
| EC = IS.synthesize(SMTSolver.get(), BPCs, PCs, LHS, RHS, IC, Timeout); | ||
| EC = IS.synthesize(SMTSolver.get(), BPCs, PCs, LHS, RHS, | ||
| Copies, PCsCopy, BPCsCopy, IC, Timeout); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no need to make copies, the only thing I need are the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, really? But we need copies for nop synthesis, what's different here?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The necessary replacements are performed in the synthesis engine in a special way that is different from the nop synthesis. |
||
| if (EC || RHS) | ||
| return EC; | ||
| } | ||
|
|
||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The synthesis engine doesn't take PCs/BPCs into account that are attached to the component library (RHS). Now, if a candidate from LHS has a PC/PBC, I should consider this during synthesis. This makes things a bit more complex. Maybe we can start without PC/BPC support first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just ignore for now.
I think the correct thing to do with pc/blockpc is to ignore them for almost all purposes (cost functions etc.) but to allow them to put constraints on the LHS, which should make synthesis work more often.