Skip to content

Commit

Permalink
Minor fixes for documentation and legacy test removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaybit0 committed Jan 31, 2025
1 parent 8bd1499 commit 39af800
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void setupDataDrivenSearch() {

/**
* Initializes the rewriter framework
* @param allowInversionCanonicalization if the conversion from a/c => a*(c^-1) should be applied (during canonicalization)
* @param allowInversionCanonicalization if the conversion from a/c => a*(c^-1) should be applied (during canonicalization)
* @param pruneNovelExpressions if only equivalence groups should be stored, where at least one expression was in the data-set
*/
public void init(boolean allowInversionCanonicalization, boolean pruneNovelExpressions) {
Expand Down Expand Up @@ -199,7 +199,7 @@ public void systematicSearch(int maxDepth) {
/**
* Performs a systematic search
* @param maxDepth the maximum number of (virtual) operands
* @param includeDuplicateReferences if the search space should be extended to contain a shared variable (e.g. +(A,B) => [+(A,B), +(A,A)])
* @param includeDuplicateReferences if the search space should be extended to contain a shared variable (e.g. +(A,B) => [+(A,B), +(A,A)])
*/
public void systematicSearch(int maxDepth, boolean includeDuplicateReferences) {
systematicSearch(0, RewriterSearchUtils.getMaxSearchNumberForNumOps(maxDepth), includeDuplicateReferences, false);
Expand All @@ -209,7 +209,7 @@ public void systematicSearch(int maxDepth, boolean includeDuplicateReferences) {
* Performs a systematic search
* @param fromIdx the start index
* @param toIdx the end index
* @param includeDuplicateReferences if the search space should be extended to contain a shared variable (e.g. +(A,B) => [+(A,B), +(A,A)])
* @param includeDuplicateReferences if the search space should be extended to contain a shared variable (e.g. +(A,B) => [+(A,B), +(A,A)])
* @param includeRowColVectors if row-vectors and col-vectors should be included in the search (note that the data-driven approach does not support this)
*/
public void systematicSearch(int fromIdx, int toIdx, boolean includeDuplicateReferences, boolean includeRowColVectors) {
Expand Down Expand Up @@ -408,7 +408,7 @@ public RewriterRuleSet getUnconditionalRuleSet() {

/**
*
* @return the conditional rule set (rules where the optimal expression may change, e.g., (A*B)+(A*C) <=> A*(B+C))
* @return the conditional rule set (rules where the optimal expression may change, e.g., (A*B)+(A*C) &lt;=&gt; A*(B+C))
*/
public RewriterRuleSet getConditionalRuleSet() {
return conditionalRuleSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,6 @@ public void testSimpleEquivalence7() {
assert stmt.match(RewriterStatement.MatcherContext.exactMatch(ctx, stmt2, stmt));
}

@Test
public void testSimpleEquivalence8() {
RewriterStatement stmt = RewriterUtils.parse("+(*(a, b), f(b, a))", ctx, "FLOAT:a,b");
RewriterStatement stmt2 = RewriterUtils.parse("+(*(b, a), f(b, a))", ctx, "FLOAT:a,b");
stmt = converter.apply(stmt);
stmt2 = converter.apply(stmt2);

LOG.info("==========");
LOG.info(stmt.toParsableString(ctx, true));
LOG.info("==========");
LOG.info(stmt2.toParsableString(ctx, true));
assert stmt.match(RewriterStatement.MatcherContext.exactMatch(ctx, stmt2, stmt));
}

@Test
public void testSimpleEquivalence9() {
RewriterStatement stmt = RewriterUtils.parse("+(*(-(a), b), *(a, a))", ctx, "FLOAT:a,b");
Expand Down

0 comments on commit 39af800

Please # to comment.