There seems to be a bug in isub/4:
5 ?- isub(abc,abc,true,S).
S = 1.0.
6 ?- isub(ab,ab,true,S).
S = 0.09999999999999998.
Am I missing something?
EDIT: It seems to happen with short lengths only:
15 ?- numlist(65,80,Cs), between(1,15,N), maplist(char_code,As,Cs), length(L,N), prefix(L,As),
atomic_list_concat(L,A), isub(A,A,true,S), S \= 1.0.
Cs = [65, 66, 67, 68, 69, 70, 71, 72, 73|...],
N = 1,
As = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'|...],
L = ['A'],
A = 'A',
S = 0.04999999999999999 ;
Cs = [65, 66, 67, 68, 69, 70, 71, 72, 73|...],
N = 2,
As = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'|...],
L = ['A', 'B'],
A = 'AB',
S = 0.09999999999999998 ;
false.
EDIT2: another strange case with length greater than 2 (although it may be a side effect of small lengths)
5 ?- isub(hks,jks,true,S). % BUG?
S = 0.0.
6 ?- isub(hkst,jkst,true,S). % OK
S = 0.8346774193548387.
7 ?- isub(hkstw,jkstw,true,S). % OK
S = 0.8731182795698925.
8 ?- isub(hkstwx,jkstwx,true,S). % OK
S = 0.8974358974358975.