Here are some notes on Markov Logic Networks, MLNs. MLNs nicely combine FOPC's ability to express knowledge about the world and probability's ability to deal with uncertainty (eg, the fact that most inference rules are not 100% correct). An MLN is a finite set of wff's where every wff has an associated weight, some real numbers (aside: if all the weights are infinity, then an MLN acts the same as std, 'pure' FOPC). For simplicity in cs540, we'll restrict our wff's to NOT involve ThereExists. Eg, we might have something like this as our knowledge base: Rule 1: wgt = 2 ForAll x [ p(x) -> q(x) ] Rule 2: wgt = 4 ForAll y,z [ r(y,z) ^ q(y) -> s(z) ] Assume we are considering a task involving only TWO people, say A (for Alice) and B (for Bob). A world state (ie, an 'interpretation') is defined by the truth values of these 10 'grounded' predicates: p(A), p(B), q(A), q(B), r(A,A), r(A,B), r(B,A), r(B,B) s(A), s(B) Since we have 10 Boolean-valued predicates, there are 2^10 (= 1024) possible world states, ranging from the world where all predicates are false to the world where all predicates are true (and including all combo's in between). What is the probability, given our knowledge base of the two rules above, of each possible world state, according to the MLN approach? It is prob(worldState) = (1/Z) exp( wgt(Rule1) x numberOfGroundingsThatAreTrue(Rule1, WorldState) + wgt(Rule2) x numberOfGroundingsThatAreTrue(Rule2, WorldState) ) [Eq 1] Here exp(x) means Euler's 'e' raised to the power 'x' and the Z is a 'normalizing' term. The item inside the exp is a weighted sum of all the 'grounded' wffs in the world state (details below). In this example, the normalizing term would be the sum of 1024 exp(x)'s, one for each possible world state. Ie, Z = exp( wgt(Rule1) x numberOfGroundingsThatAreTrue(Rule1, WorldState1) + wgt(Rule2) x numberOfGroundingsThatAreTrue(Rule2, WorldState1)) + exp( wgt(Rule1) x numberOfGroundingsThatAreTrue(Rule1, WorldState2) + wgt(Rule2) x numberOfGroundingsThatAreTrue(Rule2, WorldState2)) + ... + exp( wgt(Rule1) x numberOfGroundingsThatAreTrue(Rule1, WorldState1024) + wgt(Rule2) x numberOfGroundingsThatAreTrue(Rule2, WorldState1024)) What are the 'groundings' of a rule? They are simply the wff's that result from replacing all vars with each possible constant. In this case our constants are simply A and B, so the groundings of Rule 1 are p(A) -> q(A) p(B) -> q(B) and the groundings of Rule 2 are r(A,A) ^ q(A) -> s(A) r(A,B) ^ q(A) -> s(B) r(B,A) ^ q(B) -> s(A) r(B,B) ^ q(B) -> s(B) In 'pure' logic all groundings of a ForAll need to be true for the ForAll to be true, but in MLNs we 'soften' that up by COUNTING the number of groundings that are true. We then multiply that count by the wff's WEIGHT, and do a weighted sum over all our rules. For example, consider this world state (call it WS1): p(A)=true, p(B)=true, q(A)=true, q(B)=false, r(A,A)=true, r(A,B)=false, r(B,A)=false, r(B,B)=true s(A)=false, s(B)=true ONE of the groundings of Rule 1 is true (the first one) and THREE of the groundings of Rule 2 are true (all but the first one). So prob(WS1) = (1/Z) exp(2x1 + 4x3) = (1/Z) exp(14) Next, consider another world state (call it WS2): p(A)=true, p(B)=true, q(A)=true, q(B)=true, r(A,A)=true, r(A,B)=true, r(B,A)=true, r(B,B)=true s(A)=false, s(B)=false Here BOTH of the groundings of Rule 1 are true and ZERO of the groundings of Rule 2 are true. So prob(WS2) = (1/Z) exp(2x2 + 4x0) = (1/Z) exp(4) Hence, since the (1/Z)'s cancel prob(WS1) / prob(WS2) = exp(14) / exp(4) = exp(10) That is, given our knowledge base, we think WS1 is much more likely than WS2, even though neither world is fully consistent with our knowledge base (hence in pure logic both world states would be impossible if we fully believed our two inference rules). We can now answer any prob question we want by using Eq 1, just like we did when we fully expanded out prob's about partial world states (using the Marginalization formula) then used the formula for Bayes Networks. For example, we could answer prob( p(A) = true ^ s(A) = true | p(B)=false ^ q(A)=false ^ q(B)=true ^ r(A,A)=false^ r(A,B)=true ^ r(B,A)=false ^ r(B,B)=true ^ s(B)=true ) Doing this calc would be tedious by hand, but pretty straightforward by software. If you want to play around with some existing MLN implementations, visit: http://alchemy.cs.washington.edu/ <-- from the inventors of MLNs http://research.cs.wisc.edu/hazy/tuffy/ <-- written here at Wisc using database technology Here is a book on MLNs (I am NOT assigning it). The UW library system has a site license so you can download for free (but if you do, please keep the PDF file away from search engines): Markov Logic: An Interface Layer for Artificial Intelligence Pedro Domingos, Daniel Lowd http://www.morganclaypool.com/toc/aim/1/1 Jude