Skip to content
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

Polymorphic constants crash Z3 #469

Open
nikivazou opened this issue May 11, 2021 · 1 comment
Open

Polymorphic constants crash Z3 #469

nikivazou opened this issue May 11, 2021 · 1 comment
Assignees
Labels

Comments

@nikivazou
Copy link
Member

Consider a polymorphic constant: constant poly: func(1, [A @(0)]).
In Z3 we will encode it monomorphised, i.e., declare-fun poly () (A Int). So, once we use it as A B, e.g., in {VV : A B | [ VV = poly ] } Z3 crashes with sort mismatch.

Is there a known way to address this problem (@ranjitjhala) ?
The full .fq file is below.

data B 0 = [
       | B {}
     ]
data A 1 = [
       | A {}
     ]

// in the smt poly is declared monororpshised to Int: 
// (declare-fun poly () (A Int))
constant poly: func(1, [A @(0)])


constraint:
  env []
  lhs {VV : A B | [ VV = poly ] }
  rhs {VV : A B | [ VV = poly ] }
  id 1 tag [1]

// so the above becomes `(= VV (as poly (A B)))` and crashed with 
// "invalid qualified identifier, sort mismatch"
@ranjitjhala
Copy link
Member

@ranjitjhala ranjitjhala self-assigned this Aug 6, 2021
@ranjitjhala ranjitjhala added the bug label Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants