I am trying to write a predicate in GNU Prolog that tests if a roman numeral, stored as a list of characters, is well formed. Namely, if the list contains [i, c], [i, m], or [x, m], it is invalid. For example, if I passed in [m, i, m], the output would be no
.
How would I go about doing this? I am aware of the member/2 function; is there a way to use that to test if a list contains a sublist?