Skip to content

Add SMT Unknown Error - #330

Merged
rcosta358 merged 3 commits into
mainfrom
codex/smt-unknown-error
Oct 6, 2026
Merged

rcosta358 merged 3 commits into
mainfrom
codex/smt-unknown-error

Conversation

@rcosta358

@rcosta358 rcosta358 commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR adds a new SMTUnknownError instead of accepting refinements when Z3 returns UNKNOWN.
Includes a reason hint and the refinement declaration location.

Documentation update in #6.

Example

image

Related Issue

#303. It unexpectedly passes the verification because LJ reported unknown results as success.

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 self-assigned this Oct 5, 2026
@rcosta358 rcosta358 added the enhancement New feature or request label Oct 5, 2026
@rcosta358
rcosta358 added this pull request to stack #332 October 5, 2026 14:10

@CatarinaGamboa CatarinaGamboa left a comment

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.

So we treat the unknowns as errors, right? I think thats okay since we are in Liquid Types that should be decidable so in a way this is also a way to say if what we are trying to reason about something undecidable. The solver.getReasonUnknown() is very cool

@rcosta358

Copy link
Copy Markdown
Collaborator Author

Yes. I previously thought that it was impossible for the SMT solver to return unknown but it does when it tries to compare two values from different sorts (e.g., int and float).

@rcosta358
rcosta358 force-pushed the codex/smt-unknown-error branch from 08694c8 to 310bac3 Compare October 6, 2026 15:18
@rcosta358
rcosta358 merged commit 0e44432 into main Oct 6, 2026
1 check passed
rcosta358 added a commit that referenced this pull request Oct 6, 2026
## Description
Highlight the predicate in “Refinement declared here” diagnostics by
reading its annotation position directly, removing the dependency on
parsing order.

### Example

#### Before

<img width="810" height="270" alt="image"
src="https://github.com/user-attachments/assets/c112084f-70b5-4640-a205-2bd743932df5"
/>

#### After

<img width="625" height="273" alt="image"
src="https://github.com/user-attachments/assets/aa1323a9-5742-4077-a6c3-b28c79f39481"
/>

Validation: 206 tests passed, including declaration-position regression
tests.

## Related Issues
Stacked on #330. Merge it first, then retarget to `main`.

🤖 Generated with [Codex](https://openai.com/codex/)

---------

Co-authored-by: Codex <noreply@openai.com>
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