BLOG
1 program
Added 2026-02-23T10:05:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled
Evidence
Report issue
View issues
Aliases: Bayesian Logic
Provenance: commit a36e2760f0 · authored 2026-02-23T16:00:08+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Burglary-Earthquake Bayesian Network
Provenance: commit a36e2760f0 · authored 2026-02-23T16:00:08+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
/* The class burglary-earthquake network, as presented in "Artificial
* Intelligence: A Modern Approach", 2nd ed., p. 494.
*/
random Boolean Burglary ~ BooleanDistrib(0.001);
random Boolean Earthquake ~ BooleanDistrib(0.002);
random Boolean Alarm ~
if Burglary then
if Earthquake then BooleanDistrib(0.95)
else BooleanDistrib(0.94)
else
if Earthquake then BooleanDistrib(0.29)
else BooleanDistrib(0.001);
random Boolean JohnCalls ~
if Alarm then BooleanDistrib(0.9)
else BooleanDistrib(0.05);
random Boolean MaryCalls ~
if Alarm then BooleanDistrib(0.7)
else BooleanDistrib(0.01);
/* Evidence for the burglary model saying that both
* John and Mary called. Given this evidence, the posterior probability
* of Burglary is 0.284 (see p. 505 of "AI: A Modern Approach", 2nd ed.).
*/
obs JohnCalls = true;
obs MaryCalls = true;
/* Query for the burglary model asking whether Burglary
* is true.
*/
query Burglary;