Skip to content

Possible Mac issue #236

Description

@obroadrick

The following code works on my friend's linux machine but on my mac I get an error: "AssertionError: length(branches(bl)) == 2".

using Alea
macro bn()
return esc(quote
burglary = flip(0.001)
earthquake = flip(0.002)
if burglary && earthquake alarm = flip(0.95)
elseif burglary && !earthquake alarm = flip(0.94)
elseif !burglary && earthquake alarm = flip(0.29)
else alarm = flip(0.001) end
john_calls = if alarm flip(0.9) else flip(0.05) end
mary_calls = if alarm flip(0.7) else flip(0.01) end
end)
end
pa = @alea begin
@bn()
observe(john_calls && mary_calls)
return (burglary || earthquake)
end
pb = @alea begin
@bn()
observe(!burglary && mary_calls)
return earthquake
end
println("Pr(burglary || earthquake; john_calls && mary_calls) = $(pr(pa)[true])")
println("Pr(earthquake; !burglary && mary_calls) = $(pr(pb)[true])")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions