i'm new in prolog. i've learn about Qualitative probabilistic networks (QPN) for probabilistic reasoning. A QPN is graphical model of probabilistic influences among a set of statistical variables, in which each influence is associated with a qualitative sign. The algorithm used for reasoning in QPN is sign-propagation algorithm which is as below:
Input: a qualitative probabilistic network,Q
Output: Sign of the influence of evidence node O on each node in the network
procedure PropagateObservation(Q, O, sign, Observed):
for each Vi ϵ V (G)
do sign [Vi] ← ‘0’;
PropagateSign (Ø, O, sign).
procedure PropagateSign(trail, to, messagesign):
sign[to] ← sign [to] messagesign; *//update the sign of to
trail ← trail {to}; *// add to to the set of visited nodes
for each active neighbour Vi of to given {O} Observed
do linksign ← sign of (induced) influence between to and Vi;
messagesign ← sign [to] linksign;
if Vi ϵ trail and sign [Vi] ≠ sign [Vi] messagesign
then PropagateSign (trail, Vi, messagesign).
V = variables/nodes O = evidence node
This algorithm works with qualitative sign multiplication and addition table (Sorry, i've problem to put those tables here). I wanna write this algorithm in prolog (i use swi-prolog currently). Unfortunately, i have no idea how to start to program this algorithm in prolog since i'm a newbie and not sure whether it can be programmed in prolog. I'm sorry if my question is not very clear. please tell if i need to explain more. Maybe rough ideas from all of u might help. thank u.