From f21a2aeecf56f24509f834848c051c069db2348d Mon Sep 17 00:00:00 2001 From: Kylian Fontaine <kylian.fontaine@etu.univ-lyon1.fr> Date: Mon, 8 Jul 2024 15:41:58 +0200 Subject: [PATCH] check robot field --- lib/ast.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ast.ml b/lib/ast.ml index db07674..c76d822 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 ;; -- GitLab