File tree 3 files changed +34
-1
lines changed
3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change
1
+ livesIn(James,Yorkshire)
2
+ livesIn(Stefan,Freiburg)
3
+ burglary(James)
4
+ tornado(Freiburg)
5
+ neighborhood(James,Average)
6
+ neighborhood(Stefan,Bad)
Original file line number Diff line number Diff line change
1
+ // domain declarations
2
+ domNeighborhood = {Good, Bad, Average}
3
+ person = {James,Stefan}
4
+ place = {Freiburg,Yorkshire,Austin}
5
+
6
+
7
+
8
+ // predicate declarations
9
+ alarm(person)
10
+ burglary(person)
11
+ livesIn(person,place!)
12
+ neighborhood(person,domNeighborhood!)
13
+ tornado(place)
14
+
15
+ // formulas
16
+ 2.200000 burglary(x) => alarm(x)
17
+ 2.200000 (livesIn(x,y) ^ tornado(y)) => alarm(x)
18
+ 0.400000 neighborhood(x,Bad) => burglary(x)
19
+ -0.400000 neighborhood(x,Average) => burglary(x)
20
+ -0.800000 neighborhood(x,Good) => burglary(x)
Original file line number Diff line number Diff line change @@ -33,5 +33,12 @@ def test_db():
33
33
db .write ()
34
34
return (mln , db )
35
35
36
+ def test_reasoning ():
37
+ mln = MLN .load (files = './mln/alarm.mln' )
38
+ db = Database .load (mln , './mln/alarm.db' )
39
+ result = MLNQuery (mln = mln , db = db ).run ()
40
+ result .write ()
41
+
36
42
if __name__ == "__main__" :
37
- test_db ()
43
+ test_db ()
44
+ test_reasoning ()
You can’t perform that action at this time.
0 commit comments