problog icon indicating copy to clipboard operation
problog copied to clipboard

String library

Open Mezzenilium opened this issue 2 years ago • 3 comments

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 ?

Mezzenilium avatar Mar 12 '22 13:03 Mezzenilium

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.

rmanhaeve avatar Mar 14 '22 10:03 rmanhaeve

Thank you very much for this update on String library !

Le lun. 14 mars 2022 à 11:47, Robin Manhaeve @.***> a écrit :

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.

— Reply to this email directly, view it on GitHub https://github.com/ML-KULeuven/problog/issues/79#issuecomment-1066633452, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF46KYPPTDS6TENOQS72IODU74KLZANCNFSM5QR4L6EA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

Mezzenilium avatar Mar 14 '22 16:03 Mezzenilium

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  

Mezzenilium avatar Apr 20 '22 09:04 Mezzenilium