ML-KULeuven / problog

ProbLog is a Probabilistic Logic Programming Language for logic programs with probabilities.
https://dtai.cs.kuleuven.be/problog/
297 stars 34 forks source link

String library #79

Closed Mezzenilium closed 1 year ago

Mezzenilium commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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