Documentation Prolog Predicate Reference lists prefix/2

prefix/2

Get prefixes of list.

Description

prefix( ?list, ?list )

prefix(PrefixList, List) is true if and only if PrefixList unifies with a prefix of the list List. If PrefixList is a variable, it will unify with all the elements of List from left to right, starting with the empty list [] and finishing with the whole list.

Implementation