let bool_array_and arr1 arr2 =
  if Array.length arr1 <> Array.length arr2 then
    assert false;
  let res=Array.make (Array.length arr1) false in
  Array.iteri
    (fun i b1 -> if b1 && arr2.(i) then res.(i)<-true)
    arr1;
  res