mirror of
https://github.com/Z3Prover/z3
synced 2026-02-19 23:14:40 +00:00
* Initial plan * Update Z3_mk_datatype_sort API to accept array of parameters Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Update language bindings for parametric datatype sort API - Python: Updated DatatypeSort() to accept optional params list - OCaml: Added mk_sort_ref_p/mk_sort_ref_ps for parametric datatypes - .NET: Added MkDatatypeSortRef() methods with optional params - Java: Added mkDatatypeSortRef() methods with optional params - All changes maintain backward compatibility Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Fix .NET build error - rename params to parameters The 'params' keyword is reserved in C#, causing compilation errors. Renamed parameter from 'params' to 'parameters' in MkDatatypeSortRef methods. Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Add unit test for parametric datatypes Added test_parametric_datatype.cpp to demonstrate polymorphic datatypes. The test creates two concrete instantiations of a generic pair concept: - pair_int_real with fields (first:Int, second:Real) - pair_real_int with fields (first:Real, second:Int) Then verifies that accessors work correctly and type checking is enforced. Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Implement polymorphic type variables support for parametric datatypes - Modified datatype_decl_plugin to allow type variables as parameters - Updated mk_datatype_decl to extract type variables from field sorts - Type variables are collected in order of first appearance - Revised unit test to use Z3_mk_type_variable for polymorphic datatypes - Test creates pair datatype with type variables alpha and beta - Successfully instantiates with concrete types (pair Int Real) and (pair Real Int) - Verifies accessor types match and equality terms are well-typed - All tests pass Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Add Z3_mk_polymorphic_datatype API and refactor datatype creation - Added new API Z3_mk_polymorphic_datatype to z3_api.h - Renamed static mk_datatype_decl to api_datatype_decl in api_datatype.cpp - Modified api_datatype_decl to accept explicit type parameters - Updated all callers to use renamed function - Added test_polymorphic_datatype_api demonstrating new API usage - Both tests pass successfully Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Remove type variable collection logic from constructors Removed the logic for collecting type variables from field sorts based on constructors. * Update comments on parameter handling in api_datatype.cpp Clarify usage of parameters in API documentation. * Fix OCaml build error - use list instead of array for mk_datatype_sort Changed mk_sort_ref to pass empty list [] instead of empty array [||]. Changed mk_sort_ref_p to pass params list directly instead of converting to array. Z3native.mk_datatype_sort expects a list, not an array. Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * 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> --------- 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> |
||
|---|---|---|
| .. | ||
| converters | ||
| euf | ||
| fpa | ||
| macros | ||
| normal_forms | ||
| pattern | ||
| proofs | ||
| rewriter | ||
| simplifiers | ||
| sls | ||
| substitution | ||
| act_cache.cpp | ||
| act_cache.h | ||
| arith_decl_plugin.cpp | ||
| arith_decl_plugin.h | ||
| array_decl_plugin.cpp | ||
| array_decl_plugin.h | ||
| array_peq.cpp | ||
| array_peq.h | ||
| ast.cpp | ||
| ast.h | ||
| ast_ll_pp.cpp | ||
| ast_ll_pp.h | ||
| ast_lt.cpp | ||
| ast_lt.h | ||
| ast_pp.h | ||
| ast_pp_dot.cpp | ||
| ast_pp_dot.h | ||
| ast_pp_util.cpp | ||
| ast_pp_util.h | ||
| ast_printer.cpp | ||
| ast_printer.h | ||
| ast_smt2_pp.cpp | ||
| ast_smt2_pp.h | ||
| ast_smt_pp.cpp | ||
| ast_smt_pp.h | ||
| ast_trail.h | ||
| ast_translation.cpp | ||
| ast_translation.h | ||
| ast_util.cpp | ||
| ast_util.h | ||
| bv_decl_plugin.cpp | ||
| bv_decl_plugin.h | ||
| char_decl_plugin.cpp | ||
| char_decl_plugin.h | ||
| CMakeLists.txt | ||
| cost_evaluator.cpp | ||
| cost_evaluator.h | ||
| datatype_decl_plugin.cpp | ||
| datatype_decl_plugin.h | ||
| decl_collector.cpp | ||
| decl_collector.h | ||
| display_dimacs.cpp | ||
| display_dimacs.h | ||
| dl_decl_plugin.cpp | ||
| dl_decl_plugin.h | ||
| expr2polynomial.cpp | ||
| expr2polynomial.h | ||
| expr2var.cpp | ||
| expr2var.h | ||
| expr_abstract.cpp | ||
| expr_abstract.h | ||
| expr_delta_pair.h | ||
| expr_functors.cpp | ||
| expr_functors.h | ||
| expr_map.cpp | ||
| expr_map.h | ||
| expr_stat.cpp | ||
| expr_stat.h | ||
| expr_substitution.cpp | ||
| expr_substitution.h | ||
| finite_set_decl_plugin.cpp | ||
| finite_set_decl_plugin.h | ||
| for_each_ast.cpp | ||
| for_each_ast.h | ||
| for_each_expr.cpp | ||
| for_each_expr.h | ||
| format.cpp | ||
| format.h | ||
| fpa_decl_plugin.cpp | ||
| fpa_decl_plugin.h | ||
| func_decl_dependencies.cpp | ||
| func_decl_dependencies.h | ||
| has_free_vars.cpp | ||
| has_free_vars.h | ||
| is_variable_test.h | ||
| justified_expr.h | ||
| macro_substitution.cpp | ||
| macro_substitution.h | ||
| num_occurs.cpp | ||
| num_occurs.h | ||
| occurs.cpp | ||
| occurs.h | ||
| pb_decl_plugin.cpp | ||
| pb_decl_plugin.h | ||
| polymorphism_inst.cpp | ||
| polymorphism_inst.h | ||
| polymorphism_util.cpp | ||
| polymorphism_util.h | ||
| pp.cpp | ||
| pp.h | ||
| pp_params.pyg | ||
| quantifier_stat.cpp | ||
| quantifier_stat.h | ||
| recfun_decl_plugin.cpp | ||
| recfun_decl_plugin.h | ||
| recurse_expr.h | ||
| recurse_expr_def.h | ||
| reg_decl_plugins.cpp | ||
| reg_decl_plugins.h | ||
| scoped_proof.h | ||
| seq_decl_plugin.cpp | ||
| seq_decl_plugin.h | ||
| shared_occs.cpp | ||
| shared_occs.h | ||
| special_relations_decl_plugin.cpp | ||
| special_relations_decl_plugin.h | ||
| static_features.cpp | ||
| static_features.h | ||
| used_symbols.h | ||
| used_vars.cpp | ||
| used_vars.h | ||
| value_generator.cpp | ||
| value_generator.h | ||
| well_sorted.cpp | ||
| well_sorted.h | ||