Project

General

Profile

Revision 3b2bd83d src/basic_library.ml

View differences:

src/basic_library.ml
111 111
    VE.initial
112 112
    defs
113 113

  
114
let internal_funs = ["+";"-";"*";"/";"mod";"&&";"||";"xor";"equi";"impl";"<";">";"<=";">=";"!=";"=";"uminus";"not"]
114
let arith_funs = ["+";"-";"*";"/";"mod"; "uminus"]
115
let bool_funs  = ["&&";"||";"xor";"equi";"impl"; "not"]
116
let rel_funs   = ["<";">";"<=";">=";"!=";"="]
117

  
118
let internal_funs = arith_funs@bool_funs@rel_funs
119
 
120
let rec is_internal_fun x targs =
121
(*Format.eprintf "is_internal_fun %s %a@." x Types.print_ty (List.hd targs);*)
122
  match targs with
123
  | []                              -> assert false
124
  | t::_ when Types.is_real_type t  -> List.mem x internal_funs && not !Options.mpfr 
125
  | t::_ when Types.is_array_type t -> is_internal_fun x [Types.array_element_type t]
126
  | _                               -> List.mem x internal_funs
127

  
128
let is_expr_internal_fun expr =
129
  match expr.expr_desc with
130
  | Expr_appl (f, e, _) -> is_internal_fun f (Types.type_list_of_type e.expr_type)
131
  | _                   -> assert false
132

  
133
let is_value_internal_fun v =
134
  match v.value_desc with
135
  | Fun (f, vl) -> is_internal_fun f (List.map (fun v -> v.value_type) vl)
136
  | _           -> assert false
137

  
138
let is_homomorphic_fun x =
139
  List.mem x internal_funs
115 140

  
116
let is_internal_fun x =
141
let is_stateless_fun x =
117 142
  List.mem x internal_funs
118 143

  
119 144
let pp_c i pp_val fmt vl =

Also available in: Unified diff