Skip to content

Solve failed implies in the test-prove #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks
Stevengre opened this issue Apr 16, 2025 · 2 comments
Open
2 tasks

Solve failed implies in the test-prove #80

Stevengre opened this issue Apr 16, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Stevengre
Copy link
Contributor

Stevengre commented Apr 16, 2025

What we need to do:

  • improve the booster implies endpoint to handle this case
  • find out why my \ceil simplification does not fire.
@Stevengre Stevengre added the bug Something isn't working label Apr 16, 2025
@Stevengre Stevengre self-assigned this Apr 16, 2025
@Stevengre
Copy link
Contributor Author

Here is the response from @jberthold:

I ran the last implies request 038 from your bug report, and got the following back (consistent with the response saved in the bug report):

$ jq .result.condition.predicate implies-response.json | ../../.build/kore/bin/pretty definition.kore /dev/stdin 
Pretty-printing predicates:
Bool predicates:
  kseq(
      signExtend( VarY:SortBytes{} [ "3" ] <<Int "8" |Int VarY:SortBytes{} [ "2" ] <<Int "8" |Int VarY:SortBytes{} [ "1" ] <<Int "8" |Int VarY:SortBytes{} [ "0" ] , "32" ),
      dotk
  ) ==K kseq(
      signExtend( VarY:SortBytes{} [ "3" ] <<Int "8" |Int VarY:SortBytes{} [ "2" ] <<Int "8" |Int VarY:SortBytes{} [ "1" ] <<Int "8" |Int VarY:SortBytes{} [ "0" ] , "32" ),
      dotk
  )
Ceil predicates:
  \ceil{}(VarY:SortBytes{} [ "0" ])
  \ceil{}(VarY:SortBytes{} [ "1" ])
  \ceil{}(VarY:SortBytes{} [ "2" ])
  \ceil{}(VarY:SortBytes{} [ "3" ])
Substitution:

In the logs I can see that the request is handled completely by kore (the legacy backend), not by booster.
So the legacy backend says that the implication holds under the printed conditions.

  • The "Bool predicate" that signExtend(thing) == signExtend(thing), which is actually trivial, because thing is syntactically the same term. However, the legacy backend does not accept that to be automatically the same, because of
  • the four \ceil predicates, saying that indexing with 0, 1, 2 and 3 into the Bytes in Y is defined. (so the legacy backend is cautious not to even accept the syntactic identity).

The request does not have any condition about the lengthBytes of Y . Maybe worth a shot adding a condition 3 <=Int length(Y) ? Howeverin the definition.kore I could not find any \ceil rules about BYTES.get (which is the implementation of the indexing _ [ _ ] on bytes.

Another thing that you could try is to add an "assume-defined": true to the parameters, then booster will try to run the implication (booster does not consider ceil requirements). Of course that means you as the caller have to be certain that your Y is long enough (four bytes at least).

@Stevengre
Copy link
Contributor Author

But I think that the problem is not caused by the definedness problem, because:

  • I still failed to pass this implies even I use "assume-defined": true
  • I still fiailed after introducing the following simplification rule:
rule #Ceil(@X:Bytes[@I:Int]) => {(lengthBytes(@X) >Int @I) #Equals true} #And #Ceil(@X) #And #Ceil(@I) [simplification]

However, since I don't quite understand how the definedness transforms from / between the terms, I don't know if there any other rules should I introduce.

Additionally, I don't quite understand the preserve-definedness attribute for the simplification rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant