Skip to content

Improve Debug Logs#224

Merged
rcosta358 merged 5 commits into
mainfrom
debug-unsimplified-expressions
May 14, 2026
Merged

Improve Debug Logs#224
rcosta358 merged 5 commits into
mainfrom
debug-unsimplified-expressions

Conversation

@rcosta358
Copy link
Copy Markdown
Collaborator

Description

This PR makes it so instead of skipping the expression simplification in debug mode, it logs the unsimplified predicate and runs the simplification like normal. It also does the same for the counterexamples.

Example

image

Related Issue

None.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring

Checklist

  • Added/updated tests under liquidjava-example/src/main/java/testSuite/ (Correct* / Error*)
  • mvn test passes locally
  • Updated docs/README if behavior or API changed

@rcosta358 rcosta358 requested a review from CatarinaGamboa May 14, 2026 13:56
@rcosta358 rcosta358 self-assigned this May 14, 2026
@rcosta358 rcosta358 added the enhancement New feature or request label May 14, 2026
Copy link
Copy Markdown
Collaborator

@CatarinaGamboa CatarinaGamboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

several nits

if (!enabled()) {
return;
}
System.out.println(SMT_TAG + " unsimplified: " + predicate);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont use the smt_tag for simplification, create a SIM or SPL tag with another color to indicate what phase we are showing. Also use Unsimplified with uppercase

if (!enabled() || counterexample == null || counterexample.assignments().isEmpty()) {
return;
}
System.out.println(SMT_TAG + " unfiltered counterexample assignments:");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

System.out.println(SMT_TAG + " " + formatConclusion(conclusion));
}

public static void simplificationInput(Predicate predicate) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javadoc? also change the function name, since this is printing the unsimplified version it makes little sense to call it simplificationInput in this file - i get it from where it comes from but its not very meaningful

System.out.println(SMT_TAG + " unsimplified: " + predicate);
}

public static void counterexampleAssignments(Counterexample counterexample) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

javadoc

}

public ValDerivationNode simplify(Context context) {
DebugLog.simplificationInput(this);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should print both unsimplified and simplified predicates one next to the other so its easier to see the changes in the debug info

@rcosta358 rcosta358 requested a review from CatarinaGamboa May 14, 2026 15:17
@rcosta358
Copy link
Copy Markdown
Collaborator Author

image

if (!enabled()) {
return;
}
System.out.println(SMP_TAG + " Simplified " + Colors.CYAN + input + Colors.RESET + " to " + Colors.YELLOW
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want this in two lines if its very big so its easier to parse

@rcosta358
Copy link
Copy Markdown
Collaborator Author

image

@rcosta358 rcosta358 merged commit 886c172 into main May 14, 2026
1 check passed
@rcosta358 rcosta358 deleted the debug-unsimplified-expressions branch May 15, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants