Take the 2-minute tour ×

A truth maintenance system (TMS) stores justifications of inferences which result in a specific conclusion in a given Knowledge Base.

A good example looks like this (this is Not prolog):

∀ X good_student(X) ∧ M study_hard(X) → study_hard (X)
∀ Y party_person(Y)  → ¬study_hard (Y)

I cannot at all figure out how to implement this at all. I don't know how to represent the modal operator M (is consistent with) specifically. Obviously, I can create the predicates good_student/1, study_hard/1, and party_person/1. The linking of study_hard/1 to good_student and ¬study_hard is also where I'm lost.

This leads to my question: does anyone know how to implement anything like this in prolog?

Thanks in advance.

share|improve this question
could you explain M a little bit more? "Is consistent with" what? –  Will Ness Nov 15 '12 at 15:50
Well, there are different ways of looking at M, a modal operator in a non-monotonic domain. In this example we would look at it as Negation as Failure, where we try to prove not(study_hard(X)), otherwise we say X studies hard. cs.mtu.edu/~nilufer/classes/cs4811/2012-spring/lecture-slides/… sums up parts George Luger's chapter on the topic pretty well. –  lildigiman Nov 16 '12 at 0:30
add comment

1 Answer

You know Prolog supports a subset of First Order logic. You can't use arbitrary logic sentences, not even clauses, but definite clauses. Now in that program you have two things that are not supported: a negation in the head of a clause and a modal operator. If M is what I understand it is from your comment it's negation as failure. You have that in Prolog for free as default negation (\+ or not). For the negation in the head you have two approaches:

  1. You can try to derive a logically equivalent theory made of definite clauses using logical transformations. I'm too lazy to try this now but you can give it a go.
  2. Hey you are not the first that wants to use negation in the head. There are different frameworks that deal with that. Abductive Logic Programming systems can handle integrity constraints and can give you that negation and also the use of other modal operators for free. Even better, try Answer Set Programming. Many ASP solvers can deal with your program.

Good luck.

share|improve this answer
add comment

Your Answer


