let rec search_physical sexp ~contained =
if sexp == contained then `Found
else
match sexp with
| Atom _ -> `Not_found
| List lst ->
let rec loop i = function
| [] -> `Not_found
| h :: t ->
let res = search_physical h ~contained in
match res with
| `Not_found -> loop (i + 1) t
| #found as found -> `Pos (i, found)
in
loop 0 lst