Skip to content
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

String library #79

Closed
Mezzenilium opened this issue Mar 12, 2022 · 3 comments
Closed

String library #79

Mezzenilium opened this issue Mar 12, 2022 · 3 comments

Comments

@Mezzenilium
Copy link

A String library is listed as available in Problog documentation. But no information on its predicates is given. If this information exists, where can we find it ?

@rmanhaeve
Copy link
Contributor

The provided predicates are specified in this python file, and are somewhat self-explanatory.
https://github.com/ML-KULeuven/problog/blob/master/problog/library/string.py

We will update the documentation for these, thanks for notifying us.

@Mezzenilium
Copy link
Author

Mezzenilium commented Mar 14, 2022 via email

@Mezzenilium
Copy link
Author

Mezzenilium commented Apr 20, 2022

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)).

  o1(L) :- L = str2lst("aaaa, zzzz, eeee, rrrr").
  o2(S) :- S = lst2str(["aaa","dddd","fffff"]).
  o3(T) :- T = join('',["aaa","dddd","fffff"]).
  
  query(o1(S)).
  query(o2(S)).
  query(o3(S)).

gives

  o1(str2lst("aaaa, zzzz, eeee, rrrr")):	1         
  o2(lst2str(["aaa", "dddd", "fffff"])):	1         
  o3(join('',["aaa", "dddd", "fffff"])):	1  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants