Skip to content

Commit

Permalink
Enforce prenex polymorphism
Browse files Browse the repository at this point in the history
Alt-Ergo only supports prenex polymorphism. This commit
adds a failwith clause in `D_cnf` to enforce this property.
  • Loading branch information
Halbaroth committed May 3, 2024
1 parent 6caa060 commit 05c5dbb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/frontend/d_cnf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1472,8 +1472,14 @@ let rec mk_expr
) body binders

| Binder ((Forall (tyvl, tvl) | Exists (tyvl, tvl)) as e, body) ->
if tvl == []
then (Cache.store_tyvl tyvl; aux_mk_expr ~toplevel body)
if not toplevel && tyvl != [] then
Fmt.failwith "Non-prenex polymorphism in the term %a"
DE.Term.print term
else if tvl == []
then begin
Cache.store_tyvl tyvl;
aux_mk_expr ~toplevel:true body
end
else
let name =
if !name_tag = 0 then name_base
Expand Down

0 comments on commit 05c5dbb

Please sign in to comment.