5528 def update_field(self, field_accessor, new_value):
5529 """Return a new datatype expression with the specified field updated.
5530
5531 Args:
5532 field_accessor: The accessor function declaration for the field to update
5533 new_value: The new value for the field
5534
5535 Returns:
5536 A new datatype expression with the field updated, other fields unchanged
5537
5538 Example:
5539 >>> Person = Datatype('Person')
5540 >>> Person.declare('person', ('name', StringSort()), ('age', IntSort()))
5541 >>> Person = Person.create()
5542 >>> person_age = Person.accessor(0, 1) # age accessor
5543 >>> p = Const('p', Person)
5544 >>> p2 = p.update_field(person_age, IntVal(30))
5545 """
5546 if z3_debug():
5547 _z3_assert(is_func_decl(field_accessor), "Z3 function declaration expected")
5548 _z3_assert(is_expr(new_value), "Z3 expression expected")
5549 return _to_expr_ref(
5551 self.ctx
5552 )
5553
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.