3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-09 18:40:51 +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

@ -4628,6 +4628,13 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
return _toExpr(check(Z3.substitute_funs(contextPtr, t.ast, from, to)));
}
function updateField(t: DatatypeExpr<Name>, fieldAccessor: FuncDecl<Name>, newValue: Expr<Name>): DatatypeExpr<Name> {
_assertContext(t);
_assertContext(fieldAccessor);
_assertContext(newValue);
return _toExpr(check(Z3.datatype_update_field(contextPtr, fieldAccessor.ptr, t.ast, newValue.ast))) as DatatypeExpr<Name>;
}
function ast_from_string(s: string): Ast<Name> {
const sort_names: Z3_symbol[] = [];
const sorts: Z3_sort[] = [];
@ -4806,6 +4813,7 @@ export function createApi(Z3: Z3Core): Z3HighLevel {
substitute,
substituteVars,
substituteFuns,
updateField,
simplify,
/////////////