Skip to content

CLI flags#187

Merged
rcosta358 merged 10 commits intoliquid-java:mainfrom
cheestree:debug-flag
Apr 7, 2026
Merged

CLI flags#187
rcosta358 merged 10 commits intoliquid-java:mainfrom
cheestree:debug-flag

Conversation

@cheestree
Copy link
Copy Markdown
Contributor

@cheestree cheestree commented Mar 19, 2026

Closes #175 . This PR adds support for the --debug and --version flags as well as future implementation of new ones via the use of the picocli library.

Added picocli to extend flag usage, with the implementation of --debug to presentraw expressions, counterexamples and all expressions sent to the SMT solver.
Logging should be improved as it's not incredibly readable.
Arguments are now accessed via an object in the CommandLineLauncher class, so that it's easier in the future to implement new flags.
Copy link
Copy Markdown
Collaborator

@rcosta358 rcosta358 left a comment

Choose a reason for hiding this comment

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

LGTM. Can you show us example usages of each option?

@cheestree
Copy link
Copy Markdown
Contributor Author

There are only 2 commands as follows, with --help giving

image

and --debug like so

image

@rcosta358
Copy link
Copy Markdown
Collaborator

Looks great!

Follows suggested print formatting

Co-authored-by: Ricardo Costa <[email protected]>
@rcosta358 rcosta358 added the enhancement New feature or request label Mar 19, 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.

grest! but lets move the main print to another place to have more info

public SMTResult verifySubtype(Predicate subRef, Predicate supRef, Context context) throws Exception {
Predicate toVerify = Predicate.createConjunction(subRef, supRef.negate());
if (CommandLineLauncher.cmdArgs.debugMode) {
System.out.println(String.format("%s <: %s", subRef, supRef));
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 also report the source position (even maybe a code snippet) to accompany the print, otherwise we won't be able to identify which check is the error. Lets maybe move this print to class VCChecker, method verifySMTSubtype.

Added a util to get the expression from a SourcePosition.
Moved the print in the verifySubtype to verifySMTSubtype.
cheestree and others added 5 commits March 30, 2026 15:13
Co-authored-by: Ricardo Costa <[email protected]>
* Added version arg to CL

Added `--version` to the CL so that it shows the verifiers' current versison. Path specificity is needed due to it picking up the main pom file in the root instead of inside liquidjava-verifier.

* Updated version text

Co-authored-by: Ricardo Costa <[email protected]>

---------

Co-authored-by: Ricardo Costa <[email protected]>
@cheestree cheestree changed the title Debug flag CLI flags Apr 7, 2026
Copy link
Copy Markdown
Collaborator

@alcides alcides left a comment

Choose a reason for hiding this comment

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

LGTM

@rcosta358 rcosta358 merged commit f790481 into liquid-java:main Apr 7, 2026
1 check passed
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.

Add Debug Flag

4 participants