3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 18:05:21 +00:00

add rec decl/def to ML #4563

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-07-04 15:38:23 -07:00
parent 62b9630c4b
commit 10d0404175
3 changed files with 25 additions and 4 deletions

View file

@ -263,6 +263,8 @@ sig
end
val mk_func_decl : context -> Symbol.symbol -> Sort.sort list -> Sort.sort -> func_decl
val mk_func_decl_s : context -> string -> Sort.sort list -> Sort.sort -> func_decl
val mk_rec_fun : context > Symbol.symbol -> Sort.sort list -> Sort.sort -> func_decl
val mk_rec_fun_s : context > string -> Sort.sort list -> Sort.sort -> func_decl
val mk_fresh_func_decl : context -> string -> Sort.sort list -> Sort.sort -> func_decl
val mk_const_decl : context -> Symbol.symbol -> Sort.sort -> func_decl
val mk_const_decl_s : context -> string -> Sort.sort -> func_decl
@ -338,6 +340,15 @@ end = struct
let mk_func_decl_s (ctx:context) (name:string) (domain:Sort.sort list) (range:Sort.sort) =
mk_func_decl ctx (Symbol.mk_string ctx name) domain range
let mk_rec_fun (ctx:context) (name:Symbol.symbol) (domain:Sort.sort list) (range:Sort.sort) =
Z3native.mk_rec_fun ctx name (List.length domain) domain range
let mk_rec_fun_s (ctx:context) (name:string) (domain:Sort.sort list) (range:Sort.sort) =
mk_rec_fun ctx (Symbol.mk_string ctx name) domain range
let add_rec_def (ctx:context) (f:func_decl) (args:Expr.expr list) (body:Expr.expr)
Z3native.add_rec_def ctx f (List.length args) args body
let mk_fresh_func_decl (ctx:context) (prefix:string) (domain:Sort.sort list) (range:Sort.sort) =
Z3native.mk_fresh_func_decl ctx prefix (List.length domain) domain range

View file

@ -326,10 +326,22 @@ sig
(** Creates a new function declaration. *)
val mk_func_decl_s : context -> string -> Sort.sort list -> Sort.sort -> func_decl
(** Creates a fresh function declaration with a name prefixed with a prefix string. *)
(** Creates a function declaration that can be used in a recursive function definition.
{!add_rec_def} *)
val mk_rec_fun : context > Symbol.symbol -> Sort.sort list -> Sort.sort -> func_decl
(** Creates a function declaration that can be used in a recursive function definition.
{!add_rec_def} *)
val mk_rec_fun_s : context > string -> Sort.sort list -> Sort.sort -> func_decl
(** Registers a recursive function definition *)
val add_rec_def : context -> func_decl -> Expr.expr list -> Expr.expr -> unit
(** Creates a fresh function declaration with a name prefixed with a prefix string. *)
val mk_fresh_func_decl : context -> string -> Sort.sort list -> Sort.sort -> func_decl
(** Creates a new constant function declaration. *)
val mk_const_decl : context -> Symbol.symbol -> Sort.sort -> func_decl

View file

@ -16,8 +16,7 @@ Author:
Revision History:
--*/
#ifndef BIT_VECTOR_H_
#define BIT_VECTOR_H_
#pragma once
#include<string.h>
#include "util/debug.h"
@ -251,5 +250,4 @@ public:
}
};
#endif /* BIT_VECTOR_H_ */