Project

General

Profile

Revision b7c3790e src/mutation.ml

View differences:

src/mutation.ml
93 93

  
94 94
let rec compute_records_expr expr =
95 95
  let boolexpr = 
96
    if (Types.repr expr.expr_type).Types.tdesc = Types.Tbool then
96
    if Types.is_bool_type expr.expr_type then
97 97
      {empty_records with nb_boolexpr = 1}
98 98
    else
99 99
      empty_records
......
202 202
| _ -> op
203 203

  
204 204

  
205
let rdm_mutate_var expr = 
206
  match (Types.repr expr.expr_type).Types.tdesc with 
207
  | Types.Tbool ->
205
let rdm_mutate_var expr =
206
  if Types.is_bool_type expr.expr_type then
208 207
    (* if Random.int 100 > threshold_negate_bool_var then *)
209 208
    let new_e = mkpredef_call expr.expr_loc "not" [expr] in
210 209
    Some (expr, new_e), new_e
211 210
    (* else  *)
212
    (*   expr *)
213
  | _ -> None, expr
211
  (*   expr *)
212
  else
213
    None, expr
214 214
    
215 215
let rdm_mutate_pre orig_expr = 
216 216
  let new_e = Expr_pre orig_expr in
......
540 540
      { expr with expr_desc = new_desc }
541 541
    )
542 542
  in
543
  if (Types.repr expr.expr_type).Types.tdesc = Types.Tbool then
543
  if Types.is_bool_type expr.expr_type then
544 544
    fold_mutate_boolexpr new_expr  
545 545
  else
546 546
    new_expr

Also available in: Unified diff