diff --git a/lib/ast.ml b/lib/ast.ml index db07674464b729104ed02b42b1d9827d83dacb94..c76d822149a233b8f7ec5ba0899093f62b20239f 100644 --- a/lib/ast.ml +++ b/lib/ast.ml @@ -273,6 +273,10 @@ let info_space (i : information):bool = | Space _ -> true | _ -> false +let info_robot (i : information):bool = + match i with + | Robot _ -> true + | _ -> false (*GRAPH*) module Node = struct @@ -450,7 +454,10 @@ let check_light d : bool = else ( if not(unique info_space d') then raise(Failure "Error: Problem of defining space") - else true + else ( + if not(unique info_robot d') + then raise(Failure "Error: Problem of defining sensors") + else true) ) in if check_light d && check_activelyup d && check_sensors_desc d && aux d then true else false ;;