We are using the concept of CYK table formation to produce these results on Prolog. Here are some sample outputs for product_c(+Cell1, +Cell2, -Product):
?- product_c(["A","B"],["C","D"],What).
What = ["AC", "AD", "BC", "BD"].
?- product_c(["A"],[],What).
What = [].
I've tried using string_concat, but that gives me results like:
What = ["A", "B", "C", "D"].
I'm not sure how to go about this problem. Any help is much appreciated.