Cut And Fail In Prolog, Prolog provides a predicate that performs this function.