-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug in String library: str2lst? #84
Comments
I have made some progress in the use of the string library. I manage to have lst2str, join and concat working. But str2lst (test1) gives "An unexpected error has occurred." .
|
That might be a bug... @rmanhaeve What do you think? :- use_module(library(string)).
test1(L) :- str2lst('aaaa zzzz eeee rrrr', L).
test2(L) :- lst2str(['aaa','dddd','fffff'], L).
test3(L) :- join(',', ['aaa','dddd','fffff'], L).
test4(L) :- concat(['aaa','dddd','fffff'], L).
query(test1(_)).
%query(test2(_)).
%query(test3(_)).
%query(test4(_)). yields
The current definition of @problog_export("+str", "-list")
def str2lst(string):
return map(Term, map(make_safe, string)) should probably be @problog_export("+str", "-list")
def str2lst(string):
return list(map(Term, map(make_safe, string))) (notice return function), because right now it returns a map-function rather than a list. And since it expects to get a list ( |
I have modified the string.py file with the statement return list(map(Term, map(make_safe, string))). Thank you for your support. |
Mainly bugfixes, but we also changed the Term's hashing method. If this proofs to be worse, we may reconsider switching back later. * Bugfix library/string.py::str2lst (public issue #84) * Bugfix return exit code instead of result - only for probability task atm (public issue #82) * Critical Bugfix in dSharp library (compiled CNF theory with too long clauses could yield wrong result) * Bugfix in pypl related to lists (private issue #16) * Minor improvements to LFI * Changed Term's hashing method
I try to use the predicates of the String library of Problog2, but it does not work or I have not understood the way to properly use them :
%:- use_module(library(lists)).
:- use_module(library(string)).
gives
Originally posted by @Mezzenilium in #79 (comment)
The text was updated successfully, but these errors were encountered: