ADDED: chars_si/1, testing for a string
Examples:
?- chars_si("hello").
true.
?- chars_si(5).
false.
?- chars_si([a,b,c|Rs]).
error(instantiation_error,sort/2).
:- module(si, [atom_si/1,
integer_si/1,
atomic_si/1,
- list_si/1]).
+ list_si/1,
+ chars_si/1]).
:- use_module(library(lists)).
@@ -45,3 +46,7 @@ atomic_si(AC) :-
list_si(L) :-
\+ \+ length(L, _),
sort(L, _).
+
+chars_si(Cs) :-
+ list_si(Cs),
+ '$is_partial_string'(Cs).
