Interpreting truth value of 1 for targets

43 views
Skip to first unread message

Subhashree S cs13d029

unread,
Jan 2, 2021, 1:56:01 PM1/2/21
to PSL Users
Hi

After running a PSL program, I have got truth value 1 for many of the target atoms. I noticed that the inferred value is "1" in these 2 cases:
1. When the truth values for all the atoms in the body of the rule are "0", the truth value for the target atom which is in the head of the rule turns out to be "1".
2. When the truth values for all the atoms in the body of the rule are very high, the truth value for the target atom which is in the head of the rule turns out to be "1".  
How is this happening? Or am I missing something? While interpreting the output truth values, how do I differentiate between the above 2 cases? Or is it true that, when we know that the truth values for all the grounded atoms in the body of the rule are "0", we shouldn't be giving the atom in the head of the rule as a target to the program at all (is it true that by default we will be getting "1" as the output for the 1st case given above)?

Thanks in advance.

Charles Dickens

unread,
Jan 4, 2021, 12:14:38 PM1/4/21
to PSL Users
Hello,

This behavior you are observing is expected.

Intuitively, PSL inference aims to find a setting of the variables that satisfies the logical and arithmetic rules that are in your PSL model.
In 1. when the truth value for the body of a logical rule is "0", then the truth value for the head is free to be any value. (See the truth table for logical implication.)
In 2. when the truth value for the body of a logical rule is nearly "1" or "very high", then the rule is satisfied when the head of the rule is also nearly "1" or "very high". (Again, see the truth table for logical implication.)
For a detailed explanation of PSL inference see this paper.

Just by looking at the values of the variable in the output, it is not possible to know what is causing the variable to be set to "1", in fact, most likely it is a combination of both cases.

If you want the "default" value of a variable to be "0", one way to achieve this is by using a negative prior in your PSL model. (See negative priors in the PSL wiki rule specification.)

Hope this helps!

Connor Pryor

unread,
Jan 4, 2021, 12:57:12 PM1/4/21
to Charles Dickens, PSL Users
Hey,

I wanted to jump on this and make a quick expansion on what Charles was saying.

I believe the effect of the rule you want is if something is false, then you would like your prediction to be false. For example, suppose we are working with the rule: people who know each other should be friends

Knows(A, B) -> Friends(A, B)

Charles did a great job explaining this, because we are working with implication if Knows("Connor", "Charles") = 0 then the head Friends("Connor", "Charles") is free to be of any value. So other potentials that have the atom Friends("Connor", "Charles") will dictate what that value is. 

If we want the effect that people who don't know each other are not friends, we need to encode the negative variant of the rule.

!Knows(A, B) -> !Friends(A, B)

Now if Knows("Connor", "Charles") = 0 then !Knows("Connor", "Charles") = 1. The rule is satisfied when !Friends("Connor", "Charles") = 1 or Friends("Connor", "Charles") = 0.

Hope that helps!

-Connor

--
You received this message because you are subscribed to the Google Groups "PSL Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psl-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psl-users/bcad259b-4bfb-4857-8041-c6d006fa4351n%40googlegroups.com.

Subhashree S cs13d029

unread,
Jan 5, 2021, 2:47:05 PM1/5/21
to PSL Users
Setting a negative prior solved the issue right away. Thanks for all the help!
Reply all
Reply to author
Forward
0 new messages