Trying something different...
The task is to check for strings in A that exist (as substrings) in B, sorted.
% check for Xs in As that exist in B, in sorted order
in_array(A, B, X) :-
msort(A, Sorted),
member(X, Sorted),
in_b(X, B).
in_b(A, B) :-
member(X, B),
sub_string(X, _, _, _, A), !.
:- begin_tests(example).
:- include(example).
test(example_test) :-
A = ["live", "arp", "strong"],
B = ["lively", "alive", "harp", "sharp", "armstrong"],
findall(R, in_array(A, B, R), Actual), % setof?
assertion(Actual == ["arp", "live", "strong"]).
:- end_tests(example).