runtimeverification / runtimeverification/haskell-backend

Z3 doesn't handle some #Not (#Exists ...) predicates

Open
#3,447 0 comments 0 reactions 1 assignee View on GitHub

@ana-pantilie is already working on this.

Since Jan 18, 2023.

feature
Dominant language
Haskell
Stars
224
Forks
43
PR merge metrics
No merged PRs in 30d

Description

High priority

Z3 is unable to refute predicates like:

#Not ( 
	#Exists ITER_COUNT_F:Int . 
		     { VV6__data_3c5818c8:Bytes [ 32 *Int ?ITER_COUNT_F:Int .. #sizeByteArray ( VV6__data_3c5818c8:Bytes ) -Int 32 *Int ?ITER_COUNT_F:Int ] #Equals VV6__data_3c5818c8:Bytes [ 32 *Int ITER_COUNT_F:Int .. #sizeByteArray ( VV6__data_3c5818c8:Bytes ) -Int 32 *Int ITER_COUNT_F:Int ] } 
		#And { true #Equals 0 <=Int ITER_COUNT_F:Int }
		#And { true #Equals 32 *Int ITER_COUNT_F:Int <Int #sizeByteArray ( VV6__data_3c5818c8:Bytes ) }
		#And { true #Equals #sizeByteArray ( VV6__data_3c5818c8:Bytes ) <=Int 32 *Int ITER_COUNT_F:Int +Int 32 }
		#And { true #Equals -9 <Int #sizeByteArray ( VV6__data_3c5818c8:Bytes ) } 
	)
...
#And { true #Equals 0 <=Int ?ITER_COUNT_F:Int }
#And { true #Equals 32 *Int ?ITER_COUNT_F:Int <Int #sizeByteArray ( VV6__data_3c5818c8:Bytes ) }
#And { true #Equals #sizeByteArray ( VV6__data_3c5818c8:Bytes ) <=Int 32 *Int ?ITER_COUNT_F:Int +Int 32 }
...

@PetarMax suggests a heuristic which looks for witnesses in the free variables of the predicate.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.