From 78d1139ba0b6523d6d0012ed9918517a101bff8b Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Tue, 22 Oct 2024 13:04:41 -0700 Subject: [PATCH] add shortcut to retrieve kind of application Signed-off-by: Nikolaj Bjorner --- src/api/python/z3/z3.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api/python/z3/z3.py b/src/api/python/z3/z3.py index 43571167d0..290a8f58eb 100644 --- a/src/api/python/z3/z3.py +++ b/src/api/python/z3/z3.py @@ -1073,7 +1073,12 @@ def decl(self): _z3_assert(is_app(self), "Z3 application expected") return FuncDeclRef(Z3_get_app_decl(self.ctx_ref(), self.as_ast()), self.ctx) - + def kind(self): + """Return the Z3 internal kind of a function application.""" + if z3_debug(): + _z3_assert(is_app(self), "Z3 application expected") + return Z3_get_decl_kind(self.ctx_ref(), Z3_get_app_decl(self.ctx_ref(), self.ast)) + def num_args(self): """Return the number of arguments of a Z3 application.