Below is a fragment of a module that you should use to start this
problem.
module hw2p1.
import lists.
type one_element list A -> o.
type two_or_more_elements list A -> o.
type three_elements list A -> o.
type palindrome list A -> o.
type common_sub_seq list A -> list A -> list A -> o.
type sub_seq list A -> list A -> o.
type example int -> list int -> o.
Place code for these predicates here. If you need to add
other predicates and type declarations, please do. Use
This module fragment as a guide only.
example 0 nil.
example 1 (1::nil).
example 2 (1::3::nil).
example 3 (1::3::1::nil).
example 4 (1::3::5::8::nil).
example 5 (2::3::1::4::5::6::7::2::3::nil).
example 6 (2::3::6::5::5::6::5::2::3::4::5::6::nil).
example 7 (2::3::6::5::5::6::6::5::5::6::3::2::nil).
You should be able to have a session with Elp
similar to this one.