5924 def update_field(self, field_accessor, new_value):
5925 """Return a new datatype expression with the specified field updated.
5926
5927 Args:
5928 field_accessor: The accessor function declaration for the field to update
5929 new_value: The new value for the field
5930
5931 Returns:
5932 A new datatype expression with the field updated, other fields unchanged
5933
5934 Example:
5935 >>> Person = Datatype('Person')
5936 >>> Person.declare('person', ('name', StringSort()), ('age', IntSort()))
5937 >>> Person = Person.create()
5938 >>> person_age = Person.accessor(0, 1) # age accessor
5939 >>> p = Const('p', Person)
5940 >>> p2 = p.update_field(person_age, IntVal(30))
5941 """
5942 if z3_debug():
5943 _z3_assert(is_func_decl(field_accessor), "Z3 function declaration expected")
5944 _z3_assert(is_expr(new_value), "Z3 expression expected")
5945 return _to_expr_ref(
5947 self.ctx
5948 )
5949
Z3_ast Z3_API Z3_datatype_update_field(Z3_context c, Z3_func_decl field_access, Z3_ast t, Z3_ast value)
Update record field with a value.