Dolmen_model.Fun
module E = Dolmen.Std.Expr
exception Function_value_expected of Value.t
exception Bad_arity of E.Term.Const.t * int * Value.t list
exception Incomplete_ad_hoc_function of E.Term.Const.t
type value_function =
| Lambda of {
ty_params : E.Ty.Var.t list;
term_params : E.Term.Var.t list;
body : E.Term.t;
}
| Lazy of {
arity : int;
cst : E.Term.Const.t;
eval_lazy : Env.t -> (Env.t -> E.term -> Value.t) -> E.term list -> Value.t;
}
| Poly of {
arity : int;
cst : E.Term.Const.t;
eval_p : E.Ty.t list -> Value.t list -> Value.t;
}
| Ad_hoc of {
arity : int;
ty_arity : int;
cst : E.Term.Const.t;
eval_l : (E.Ty.t list * (E.Ty.subst -> value_function)) list;
}
val print_ad_hoc_case : Stdlib.Format.formatter -> (E.Ty.t list * 'a) -> unit
val print : Stdlib.Format.formatter -> t -> unit
val mk_clos : value_function -> Value.t
val ad_hoc :
cst:E.Term.Const.t ->
arity:int ->
ty_arity:int ->
(E.Ty.t list * (E.Ty.subst -> value_function)) list ->
value_function
val lambda : E.Ty.Var.t list -> E.Term.Var.t list -> E.Term.t -> value_function
val fun_lazy :
cst:E.Term.Const.t ->
(Env.t -> (Env.t -> E.term -> Value.t) -> E.term list -> Value.t) ->
value_function
val poly :
arity:int ->
cst:E.Term.Const.t ->
(E.Ty.t list -> Value.t list -> Value.t) ->
value_function
val builtin :
arity:int ->
cst:E.Term.Const.t ->
(Value.t list -> Value.t) ->
value_function
val fun_1 : cst:E.Term.Const.t -> (Value.t -> Value.t) -> value_function
val fun_2 :
cst:E.Term.Const.t ->
(Value.t -> Value.t -> Value.t) ->
value_function
val fun_3 :
cst:E.Term.Const.t ->
(Value.t -> Value.t -> Value.t -> Value.t) ->
value_function
val fun_4 :
cst:E.Term.Const.t ->
(Value.t -> Value.t -> Value.t -> Value.t -> Value.t) ->
value_function
val fun_n : cst:E.Term.Const.t -> (Value.t list -> Value.t) -> Value.t
val arity : value_function -> int
val reduce_ty :
eval:'a ->
cst:E.Term.Const.t ->
'b ->
E.Ty.t list ->
(E.Ty.t list * (E.Ty.subst -> 'c)) list ->
'c
val add_ad_hoc_instance :
Dolmen_model__Model.t ->
cst:Dolmen.Std.Expr.Term.Const.t ->
ty_args:E.Ty.t list ->
term_params:E.Term.Var.t list ->
body:E.Term.t ->
Dolmen_model__Model.t