Prolog and Probability

Print PDF

An extended PROLOG system, which is capable of processing the probabilistic values of the acquired data, is under development in ADES system. A patch file, which is applicaple to CS-Prolog v1.1.1, can be found on the downloads section. This patch enables assigning probabilistic values to the facts.

Sample input file (a.pl):

violation(X) :- noturn(X), steer(X), lanedept(X).

"0.85::noturn(left)".
"0.8::steer(left)".

"0.1::noturn(right)".
"0.2::steer(right)".
"0.5::lanedept(right)".

"0.9::lanedept(left)".

Sample run:

1 ?- [a].
--- Consulting C:\java\eclipse\workspace\CSProlog\CSProlog\bin\Debug\a.pl ... 16
 lines read

yes (0,078 sec)

2 ?- violation(X).
Prob for noturn is 0,85
Prob for steer is 0,8
Prob for lanedept is 0,9
Prob for this answer:0,612

X = left (0,000 sec) more? (y/n)y
Prob for noturn is 0,1
Prob for steer is 0,2
Prob for lanedept is 0,5
Prob for this answer:0,01

X = right (0,000 sec) more? (y/n)y

no

3 ?- Halt.

 

 
Turkish (Turkiye)English (United Kingdom)

Share It!