Groebner bases and constructive multidimensional behavioural theory