A surgical controlling system includes a controller having a processing means communicable with a controller's database, said controller configured to control the spatial position of a surgical tool. The controller's database is in communication with movement detection means. The controller's database is configured to store a predetermined set of rules according to which allowed and restricted movements of the surgical tool are determined, each detected movement by said movement detection means of said at least one surgical tool being determined as either an allowed movement or as a restricted movement according to said predetermined set of rules. The system automatically real-time analyzes and determines the location of each anatomical element in the surgical environment.