How to call split_string predicate in swi-prolog?

I am trying to use the supposedly built-in predicate split_string / 4 from the documentation here: http://www.swi-prolog.org/pldoc/man?predicate=split_string/4

However, when I try to use it, as in the example, I get something like this:

?- split_string("a.b.c.d", ".", "", L).
ERROR: toplevel: Undefined procedure: split_string/4 (DWIM could not correct goal)

What am I doing wrong? Should I download the library first?

+4
source share
1 answer

split_string/4 - SWI- , SWI7. Prolog, SICStus, ISO, . , codes, . ' " Prolog?

SWI, SWI6 , concat_atom/3 resp. atomic_list_concat/3, .

?- atomic_list_concat(L,'_',a_b__c).
L = [a,b,'',c].

ISO: atom_concat/3 sub_atom/5, . atomic_list_concat/3 .

+5

Source: https://habr.com/ru/post/1544524/


All Articles