Reference no: EM132212114
Write a Prolog rule(s) to determine if a list has two consecutive elements both having a specified value.
Example queries using your rule:
consec([1,2,3,4], 3). % fail
consec([1,3,2,2,3,4], 3). % fail
consec([1,2,3,3,4], 3). % succeed
consec([1,2,3,3,4], X). % succeed, with X bound to 3