3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-13 20:33:02 +00:00

Add datatype_update_field to C++, Python, TypeScript, and OCaml bindings

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-04 21:57:57 +00:00
parent d9bb80cf89
commit ac39c021bf
5 changed files with 61 additions and 0 deletions

View file

@ -961,6 +961,9 @@ struct
let g j = Z3native.get_datatype_sort_constructor_accessor (Sort.gc x) x i j in
List.init ds g) in
List.init n f
let update_field (ctx:context) (field_access:FuncDecl.func_decl) (t:Expr.expr) (v:Expr.expr) =
Z3native.datatype_update_field ctx field_access t v
end

View file

@ -1130,6 +1130,12 @@ sig
(** The constructor accessors. *)
val get_accessors : Sort.sort -> FuncDecl.func_decl list list
(** Update a datatype field at expression [t] with value [v].
The function performs a record update at [t]. The field
that is passed in as argument is updated with value [v],
the remaining fields of [t] are unchanged. *)
val update_field : context -> FuncDecl.func_decl -> Expr.expr -> Expr.expr -> Expr.expr
end
(** Functions to manipulate Enumeration expressions *)