kuntilanak
IS-IT--Management
I have a function called :
match_pre([test], K) :- !, append([S|T],_, K), length([S|T],1), test(S)
and I have a huge database of predicates which succeeds if S is in the database, example:
test(a).
test(b).
test(z).
test(u).
test(h).
etc......
Now I want to create another function that matches from right to left, how can I do that? In other words,
say the function is called match_suf([test], ).
I want it to say:
true;
no
I want to match is a [test], instead of doing it the original left to right way
match_pre([test], K) :- !, append([S|T],_, K), length([S|T],1), test(S)
and I have a huge database of predicates which succeeds if S is in the database, example:
test(a).
test(b).
test(z).
test(u).
test(h).
etc......
Now I want to create another function that matches from right to left, how can I do that? In other words,
say the function is called match_suf([test], ).
I want it to say:
true;
no
I want to match is a [test], instead of doing it the original left to right way