5a19adf881
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1966 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
24 lines
368 B
Plaintext
24 lines
368 B
Plaintext
/*
|
|
?- s([heads(C)],P).
|
|
C = coin1
|
|
P = 0.51 ? ;
|
|
C = coin2
|
|
P = 0.51 ? ;
|
|
no
|
|
?- s([tails(C)],P).
|
|
C = coin1
|
|
P = 0.49 ? ;
|
|
C = coin2
|
|
P = 0.49 ? ;
|
|
no
|
|
|
|
s([tails(coin1)],P).
|
|
P = 0.49 ?
|
|
*/
|
|
|
|
heads(Coin): 0.5; tails(Coin) : 0.5:-toss(Coin),fair(Coin).
|
|
heads(Coin): 0.6 ; tails(Coin) : 0.4:-toss(Coin),biased(Coin).
|
|
fair(Coin):0.9 ; biased(Coin):0.1.
|
|
toss(coin1).
|
|
toss(coin2).
|