3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-18 06:34:22 +00:00

Add polymorphic datatype support to ML API (#8378)

* Initial plan

* Add ML bindings for polymorphic datatypes (mk_type_variable and mk_polymorphic_sort)

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Add polymorphic datatype example for ML API

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Delete examples/ml/polymorphic_datatype_example.ml

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Copilot 2026-01-27 11:44:35 -08:00 committed by GitHub
parent 105bc0fd57
commit 01948e168b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 0 deletions

View file

@ -290,6 +290,12 @@ sig
(** Create a new uninterpreted sort. *)
val mk_uninterpreted_s : context -> string -> sort
(** Create a type variable sort for use in polymorphic datatypes. *)
val mk_type_variable : context -> Symbol.symbol -> sort
(** Create a type variable sort for use in polymorphic datatypes. *)
val mk_type_variable_s : context -> string -> sort
end
(** Function declarations *)
@ -1099,6 +1105,14 @@ sig
(** Create a new datatype sort. *)
val mk_sort_s : context -> string -> Constructor.constructor list -> Sort.sort
(** Create a new polymorphic datatype sort with type parameters.
Type parameters should be created using Sort.mk_type_variable. *)
val mk_polymorphic_sort : context -> Symbol.symbol -> Sort.sort list -> Constructor.constructor list -> Sort.sort
(** Create a new polymorphic datatype sort with type parameters.
Type parameters should be created using Sort.mk_type_variable. *)
val mk_polymorphic_sort_s : context -> string -> Sort.sort list -> Constructor.constructor list -> Sort.sort
(** Create mutually recursive datatypes. *)
val mk_sorts : context -> Symbol.symbol list -> Constructor.constructor list list -> Sort.sort list