Question: I am developing a predicate in Prolog and it is possible for it to terminate before the end of it. 
For that reason I was looking for a command similar to `return;` (C++). I used a `cut !` but I'm doubtful as to what it literally stands for and if it does exactly what `return;` does. Ex:

```
pred(X) :- 
           X = 1 -> do this, !; else do that,
           write('x =/= 1').

void pred(int X) {
       if (X = 1) {do this; return;} else do that;
       cout << "x =/= 1";
}

```

Are the functions above exactly the same?

Answer: 
There is no direct correspondence of Prolog's execution mechanism and those of traditional imperative languages. So any analogy rather leads you on a dead path.

In your example, the cut has no effect whatsoever: The `(->)/2` alone will already exclude the `Else` branch. In a sense it does a "tiny" cut on `If` and the alternative. Would there be another clause to `pred/1`, your cut would exclude that branch too.

Prolog's execution mechanism is much more complex. If you insist on an analogy in imperative languages, think of iterators. The cut causes all iterators in scope of the cut to produce a done on the next `next`. So it is a bit like a `break`. Somewhat. But only in a language that supports iterators in the first place.

If you want to learn Prolog, don't try to develop your notions out of these (half) broken analogies.

Better start by imagining what relations a Prolog predicate describes and approximate from that the meaning of a predicate. Procedural notions will fit in, one by one.
I would like to add that having solid coding guidelines can also help quite a bit to increase code readability and to avoid code brittleness.

Starting with @DanielLyons' code:

```
foo :-
  cond1 -> 
    handle_cond1
  ; (cond2 ->
       handle_cond2
     ; do_other_stuff 
     ).

```

In practice, cascades of multiple nested if-then-else constructs occur: "if-then-elseif-then-elseif-then-elseif-then-...-else".

To increase readability, the code layout can be brushed up and the level of indentation adjusted:

```
foo :-
   (  cond1 -> handle_cond1
   ;  cond2 -> handle_cond2
   ;           do_other_stuff 
   ).

```

Whenever code lines get too wide, a slightly less wide and more tall style may be preferable:

```
foo :-
   (  cond1
   -> handle_cond1
   ;  cond2 
   -> handle_cond2
   ;  do_other_stuff 
   ).

```