Skip to content

Commit

Permalink
Fix issue 1099
Browse files Browse the repository at this point in the history
The `D_cnf` module didn't use the flag `toplevel` as it was done in `Cnf`.
This flag is important because the `Expr` AST doesn't store quantified
type variables with binders as it does for the term variable. Instead, we
use a `prenex polymorphism` approach, which means the quantified type
variables are at the top level only.

I believe this PR fixes the issue OCamlPro#1099.
  • Loading branch information
Halbaroth committed Apr 30, 2024
1 parent 05e98a4 commit a55dcc8
Show file tree
Hide file tree
Showing 4 changed files with 304 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/frontend/d_cnf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ let rec mk_expr

| Binder ((Forall (tyvl, tvl) | Exists (tyvl, tvl)) as e, body) ->
if tvl == []
then (Cache.store_tyvl tyvl; aux_mk_expr ~toplevel body)
then (Cache.store_tyvl tyvl; aux_mk_expr ~toplevel:false body)
else
let name =
if !name_tag = 0 then name_base
Expand Down
294 changes: 293 additions & 1 deletion tests/dune.inc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions tests/issues/1099.ae
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type 'a t
logic p : 'a t, unit -> prop
logic f : 'a t -> prop
logic r : unit t

axiom a : forall s:'a t. exists n:unit. p(s, n)

goal g : f(r)
2 changes: 2 additions & 0 deletions tests/issues/1099.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

unknown

0 comments on commit a55dcc8

Please sign in to comment.