3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-20 18:20:22 +00:00

Added accessors to enumeration sorts. Thanks to codeplex user steimann for suggesting this.

(http://z3.codeplex.com/workitem/195)

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2015-03-24 21:42:05 +00:00
parent b76d588c28
commit 1c77ad00c3
5 changed files with 87 additions and 4 deletions

View file

@ -1390,11 +1390,24 @@ struct
let f i = (func_decl_of_ptr (Sort.gc x) (Z3native.get_datatype_sort_constructor (Sort.gnc x) (Sort.gno x) i)) in
mk_list f n
let get_const_decl ( x : sort ) ( inx : int ) =
func_decl_of_ptr (Sort.gc x) (Z3native.get_datatype_sort_constructor (Sort.gnc x) (Sort.gno x) inx)
let get_consts ( x : sort ) =
let n = Z3native.get_datatype_sort_num_constructors (Sort.gnc x) (Sort.gno x) in
let f i = (Expr.mk_const_f (Sort.gc x) (get_const_decl x i)) in
mk_list f n
let get_const ( x : sort ) ( inx : int ) =
Expr.mk_const_f (Sort.gc x) (get_const_decl x inx)
let get_tester_decls ( x : sort ) =
let n = Z3native.get_datatype_sort_num_constructors (Sort.gnc x) (Sort.gno x) in
let f i = (func_decl_of_ptr (Sort.gc x) (Z3native.get_datatype_sort_recognizer (Sort.gnc x) (Sort.gno x) i)) in
let f i = (func_decl_of_ptr (Sort.gc x) (Z3native.get_datatype_sort_recognizer (Sort.gnc x) (Sort.gno x) i)) in
mk_list f n
let get_tester_decl ( x : sort ) ( inx : int ) =
func_decl_of_ptr (Sort.gc x) (Z3native.get_datatype_sort_recognizer (Sort.gnc x) (Sort.gno x) inx)
end