mirror of
https://github.com/Z3Prover/z3
synced 2026-05-01 16:13:44 +00:00
Add polymorphic datatype example to C++ examples
Added polymorphic_datatype_example() demonstrating: - Creating type variables alpha and beta with Z3_mk_type_variable - Defining parametric Pair datatype with fields of type alpha and beta - Instantiating with concrete types (Pair Int Real) and (Pair Real Int) - Getting constructors and accessors from instantiated datatypes - Creating constants and expressions using the polymorphic types - Verifying type correctness with equality (= (first p1) (second p2)) Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
efc1b1c297
commit
6406265800
1 changed files with 90 additions and 0 deletions
Loading…
Add table
Add a link
Reference in a new issue