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).
This commit is contained in:
@@ -27,7 +27,8 @@
|
|||||||
:- module(si, [atom_si/1,
|
:- module(si, [atom_si/1,
|
||||||
integer_si/1,
|
integer_si/1,
|
||||||
atomic_si/1,
|
atomic_si/1,
|
||||||
list_si/1]).
|
list_si/1,
|
||||||
|
chars_si/1]).
|
||||||
|
|
||||||
:- use_module(library(lists)).
|
:- use_module(library(lists)).
|
||||||
|
|
||||||
@@ -45,3 +46,7 @@ atomic_si(AC) :-
|
|||||||
list_si(L) :-
|
list_si(L) :-
|
||||||
\+ \+ length(L, _),
|
\+ \+ length(L, _),
|
||||||
sort(L, _).
|
sort(L, _).
|
||||||
|
|
||||||
|
chars_si(Cs) :-
|
||||||
|
list_si(Cs),
|
||||||
|
'$is_partial_string'(Cs).
|
||||||
|
|||||||
Reference in New Issue
Block a user