None of the programs work because they contain infinite recursion. You cause coordenate within yourself, without a stop condition.
Then, to help you with your initial problem of increasing a variable in place: you cannot do this in Prolog. Once a variable is bound, you cannot change its binding. When programming in Prolog, you should think in terms of relationships and recursion rather than mutable state. Here's how to enlarge in Prolog:
incr(X, X1) :- X1 is X+1.
Note that two variables are needed: one for storing the original value and one for the incremental value. To do something useful in the computation that runs this predicate, both variables must be predicate arguments. The first means the input argument, the second as the output argument (although this is not reflected in the language, this follows from the way is/2 works).
source share