From: Mart Lubbers Date: Tue, 6 Jan 2015 10:07:17 +0000 (+0100) Subject: working ailog code jow X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=861b8a15e4bd9692e1ab4eed53bf6f457ef74f18;p=ker2014-2.git working ailog code jow --- diff --git a/report/src/alarm.ail b/report/src/alarm.ail index 4e1c077..3a1b615 100644 --- a/report/src/alarm.ail +++ b/report/src/alarm.ail @@ -1,42 +1,42 @@ -prob earthquake: 1/(365 + 0.25 + 0.01 + 0.0025) -prob burglar: 1/(365 + 0.25 + 0.01 + 0.0025) +prob earthquake: 1/(365 + 0.25 + 0.01 + 0.0025). +prob burglar: 1/(365 + 0.25 + 0.01 + 0.0025). -% P(i1 | earthquake): -i1 <- earthquake & i1WhenEartquake -prob i1WhenEartquake: 0.2 -i1 <- ~earthquake & i1WhenNotEartquake -prob i1WhenNotEartquake: 0 +% P(i1 | earthquake):. +i1 <- earthquake & i1WhenEartquake. +prob i1WhenEartquake: 0.2. +i1 <- ~earthquake & i1WhenNotEartquake. +prob i1WhenNotEartquake: 0. -% P(i2 | burglar): -i2 <- burglar & i2WhenBurglar -prob i2WhenBurglar: 0.95 -i2 <- ~burglar & i2WhenNotBurglar -prob i2WhenNotBurglar: 0 +% P(i2 | burglar):. +i2 <- burglar & i2WhenBurglar . +prob i2WhenBurglar: 0.95. +i2 <- ~burglar & i2WhenNotBurglar. +prob i2WhenNotBurglar: 0. -% P(Alarm | i1, i2): -Alarm <- i1 & i2 & i1i2both -prob i1i2both: 1 -Alarm <- ~i1 & i2 & i1i2i2 -prob i1i2i2: 1 -Alarm <- i1 & ~i2 & i1i2i1 -prob i1i2i1: 1 -Alarm <- i1 & ~i2 & i1i2none -prob i1i2none: 0 +% P(alarm | i1, i2):. +alarm <- i1 & i2 & i1i2both. +prob i1i2both: 1. +alarm <- ~i1 & i2 & i1i2i2. +prob i1i2i2: 1. +alarm <- i1 & ~i2 & i1i2i1. +prob i1i2i1: 1. +alarm <- i1 & ~i2 & i1i2none. +prob i1i2none: 0. -% P(Gibbons calls | Alarm) -Gibbons <- Alarm & GibbonsWhenAlarm -prob GibbonsWhenAlarm: 0.99 -Gibbons <- ~Alarm & GibbonsWhenNoAlarm -prob GibbonsWhenNoAlarm: 0.04 +% P(gibbons calls | alarm). +gibbons <- alarm & gibbonsWhenalarm. +prob gibbonsWhenalarm: 0.99. +gibbons <- ~alarm & gibbonsWhenNoalarm. +prob gibbonsWhenNoalarm: 0.04. -% P(Watson calls | Alarm) -Watson <- Alarm & WatsonWhenAlarm -prob WatsonWhenAlarm: 0.8 -Watson <- ~Alarm & WatsonWhenNoAlarm -prob WatsonWhenNoAlarm: 0.4 +% P(watson calls | alarm). +watson <- alarm & watsonWhenalarm. +prob watsonWhenalarm: 0.8. +watson <- ~alarm & watsonWhenNoalarm. +prob watsonWhenNoalarm: 0.4. -% P(Radio | earthquake) -Radio <- earthquake & RadioWhenEarthquake -prob RadioWhenEarthquake: 0.9998 -Radio <- ~earthquake & RadioWhenNoEarthquake -prob RadioWhenNoEarthquake: 0.0002 +% P(radio | earthquake). +radio <- earthquake & radioWhenEarthquake. +prob radioWhenEarthquake: 0.9998. +radio <- ~earthquake & radioWhenNoEarthquake. +prob radioWhenNoEarthquake: 0.0002.