Here is a definition of prefix in Prolog.

  prefix([],Y).
  prefix([A|X], [A|Y]) :- prefix(X,Y).

The first axiom says that the empty list is a prefix of any list. The second axiom says that A::X is a prefix of A::Y when X is a prefix of Y.

It is instructive to look at the same thing written in a functional style. Here it is, with an attempt to make it look similar to the Prolog definition.

  prefix([],x)       = true
  prefix(a::x, a::y) = prefix(x,y)

  prefix(a::x, [])   = false
  prefix(a::x, b::y) = false  when a =/= b

Notice that the first two cases, which handle positive information (about when one list is a prefix of another list) correspond closely to the Prolog axioms. The last two cases are concerned with negative information (when one list is not a prefix of another list). In Prolog, you do not state negative information. It is implicit by the fact that you have not stated it.