ML-KULeuven / problog

ProbLog is a Probabilistic Logic Programming Language for logic programs with probabilities.

Home Page:https://dtai.cs.kuleuven.be/problog/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to define rules(facts) using Problog Python

smejkka3 opened this issue · comments

Hi,

I'm trying to implement bellow rules in problog python package:

Screenshot 2022-06-10 at 21 01 11

As a simple example of rdfs11 I can use:

(John SUBCLASS student) (student SUBCLASS person) -> (John SUBCLASS person)
with arbitrary defined probabilities on the first and second SUBCLASS rules (facts).

Currently I'm struggling to define any of these so I'm not even sure if it possible in Problog.

Thanks in advance

Would a rule like this suffice?

subclass(X,Y) :- subclass(X,Z), subclass(Z,Y).

Thanks, I was able to generalise it for the rest of the rules

Hi,

is it possible to create rule like this?

triple(estonia, subclass, europianunion).
triple(europianunion, subclass, europe).

triple(X,subclass,Z) :- triple(X,subclass,Y), triple(Y,subclass,Z)

the problog doesn't seem to know how to parse this?

Hi,

is it possible to create rule like this?

triple(estonia, subclass, europianunion). triple(europianunion, subclass, europe).

triple(X,subclass,Z) :- triple(X,subclass,Y), triple(Y,subclass,Z)

the problog doesn't seem to know how to parse this?

Are you sure you're not just missing the dot at the end of the rule? Seems to work fine for me otherwise:
https://dtai.cs.kuleuven.be/problog/editor.html#task=prob&hash=d83e894c00d3696f609d934c658db24f