Answers.Body: <p>Here is a (very) brief <a href="https://en.wikipedia.org/wiki/Consistency_(knowledge_bases)" rel="nofollow noreferrer">wikipedia article on consistency in KB's</a>, which should answer your question.</p>
  
  <p>A KB is consistent, if it does not contain any contradictions, ie <span class="math-container">$\lnot a$</span> and <span class="math-container">$a$</span> are not both derivable from it. Which is pretty much common sense if you think about it.</p>
  
  <p>If I have a formula <span class="math-container">$f$</span>, for example "A is a trout <span class="math-container">$\land$</span> A lays eggs", and my KB contains "fish lay eggs" and "a trout is a fish", then, if <span class="math-container">$f$</span> is true, ie trout do lay eggs, that formula is consistent with my KB, which states that trout are fish and that fish lay eggs.</p>
  
  <p>Edit: for a more formalised version, see nbro's answer.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-10T13:11:34.750Z
Answers.LastActivityDate: 2019-02-10T13:11:34.750Z
Answers.UserDisplayName: Oliver Mason
Answers.Body: <p>I will first recapitulate the key concepts which you need to know in order to understand the answer to your question (which will be very simple, because I will just try to clarify what is given as a &quot;definition&quot;).</p>
  <p>In logic, a <strong>formula</strong> is e.g. <span class="math-container">$f$</span>, <span class="math-container">$\lnot f$</span>, <span class="math-container">$f \land g$</span>, where <span class="math-container">$f$</span> can be e.g. the <strong>proposition</strong> (or <em>variable</em>) &quot;today it will rain&quot;.  So, in a (propositional) formula, you have <em>propositions</em>, i.e. sentences like &quot;today it will rain&quot;, and logical <strong>connectives</strong>, i.e. symbols like <span class="math-container">$\land$</span> (i.e. logical AND), which logically <em>connect</em> these sentences. The propositions like &quot;today it will rain&quot; can often be denoted by a single (capital) letter like <span class="math-container">$P$</span>. <span class="math-container">$f \land g$</span> is the combination of two formulae (where <em>formulae</em> is the plural of <em>formula</em>). So, for example, suppose that <span class="math-container">$f$</span> is composed of the propositions &quot;today it will rain&quot; (denoted by <span class="math-container">$P$</span>) <em>or</em> &quot;my friend will visit me&quot; (denoted by <span class="math-container">$Q$</span>) and <span class="math-container">$f$</span> is defined as &quot;I will play with my friend&quot; (denoted by <span class="math-container">$S$</span>). Then the formula <span class="math-container">$f \land g = (P \lor Q) \land S$</span>. In general, you can combine formulae in any logically appropriate way.</p>
  <p>In this context, a <strong>model</strong> is an <em>assignment</em> to each variable in a formula. For example, suppose <span class="math-container">$f = P \lor Q$</span>, then <span class="math-container">$w = \{ P=0, Q = 1\}$</span> is a <em>model</em> for <span class="math-container">$f$</span>, that is, each variable (e.g. <span class="math-container">$P$</span>) is assigned either &quot;true&quot; (<span class="math-container">$1$</span>) or &quot;false&quot; (<span class="math-container">$0$</span>) but <em>not</em> both. (Note that <a href="https://ai.stackexchange.com/a/25460/2444">the word <em>model</em> may be used to refer to different concepts depending on the context</a>; again, in this context, you can simply think of a model as <em>an assignment of values to the variables in a formula</em>.)</p>
  <p>Suppose now we define <span class="math-container">$I(f, w)$</span> to be a <em>function that receives the formula <span class="math-container">$f$</span> and the model <span class="math-container">$w$</span> as input, and <span class="math-container">$I$</span> returns either &quot;true&quot; (<span class="math-container">$1$</span>) or &quot;false&quot; (<span class="math-container">$0$</span>)</em>. In other words, <span class="math-container">$I$</span> is a function that <em>automatically</em> tells us if <span class="math-container">$f$</span> is evaluated to true or false given the assignment <span class="math-container">$w$</span>.</p>
  <p>You can now define <span class="math-container">$M(f)$</span> to be a <em>set of assignments (or models) to the formula <span class="math-container">$f$</span> such that <span class="math-container">$f$</span> is true</em>. So, <span class="math-container">$M$</span> is a set and not just an assignment (or model). This set can be empty, it can contain one assignment or it can contain any number of assignments: it depends on the formula <span class="math-container">$f$</span>: in some cases, <span class="math-container">$M$</span> is empty and, in other cases, it may contain say <span class="math-container">$n$</span> valid assignments to <span class="math-container">$f$</span>, where by &quot;valid&quot; I mean that these assignments make <span class="math-container">$f$</span> evaluate to &quot;true&quot;. For example, suppose we have formula <span class="math-container">$f = A \land \lnot A$</span>. Then you can try to assign any value to <span class="math-container">$A$</span>, but <span class="math-container">$f$</span> will never evaluate to true. In that case, <span class="math-container">$M(f)$</span> is an empty set, because there is no assignment to the variables (or propositions) of <span class="math-container">$f$</span> which make <span class="math-container">$f$</span> evaluate to true.</p>
  <p>A <strong>knowledge base</strong> is a set of formulae <span class="math-container">$\text{KB} = \{ f_1, f_2, \dots, f_n \}$</span>. So, for example, <span class="math-container">$f_2 = $</span> &quot;today it will rain&quot; and <span class="math-container">$f_3 = $</span> &quot;I will go to school AND I will have lunch&quot;.</p>
  <p>We can now define <span class="math-container">$M(\text{KB})$</span> to be the <em>set of assignments to the formulae in the knowledge base <span class="math-container">$\text{KB}$</span> such that all formulae are true</em>. If you think of the formulae in <span class="math-container">$KB$</span> as &quot;facts&quot;, <span class="math-container">$M(\text{KB})$</span> is an assignment to these formulae in <span class="math-container">$KB$</span> such that these facts hold or are true.</p>
  <p>In this context, we then say that a particular knowledge base (i.e., a set of formulae as defined above), denoted by <span class="math-container">$\text{KB}$</span>, is <em>consistent with formula <span class="math-container">$f$</span> if <span class="math-container">$M(\text{KB} \cup \{ f \})$</span> is a non-empty set</em>, where <span class="math-container">$\cup$</span> means the <em>union</em> operation between sets: note that (as we defined it above) <span class="math-container">$\text{KB}$</span> is a set, and <span class="math-container">$\{ f \}$</span> means that we are making a set out of the formula <span class="math-container">$f$</span>, so we are indeed performing an <em>union</em> operation on sets.</p>
  <p>So, what does it mean for a knowledge base to be consistent? First of all, the consistency of a knowledge base <span class="math-container">$\text{KB}$</span> is defined <em>with respect to</em> another formula <span class="math-container">$f$</span>. Recall that a knowledge base is a set of formulae, so we are defining the consistency of a set of formulae with respect to another formula.</p>
  <p>When is then a knowledge base <span class="math-container">$\text{KB}$</span> consistent with a formula <span class="math-container">$f$</span>? When <span class="math-container">$M(\text{KB} \cup \{ f \})$</span> is a non-empty set. Recall that <span class="math-container">$M$</span> is an assignment to the variables in its input such that its inputs evaluate to true. So, <span class="math-container">$\text{KB}$</span> is consistent with <span class="math-container">$f$</span> when there is a set of assignments of values to the formulae in <span class="math-container">$\text{KB}$</span> and an assignment of values to the variables in <span class="math-container">$f$</span> such that <em>both</em> <span class="math-container">$\text{KB}$</span> and <span class="math-container">$f$</span> are true. In other words, <span class="math-container">$\text{KB}$</span> is consistent with <span class="math-container">$f$</span> when both all formulae in <span class="math-container">$\text{KB}$</span> and <span class="math-container">$f$</span> can be true <em>at the same time</em>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-10T13:10:40.177Z
Answers.LastActivityDate: 2021-01-21T18:44:09.463Z
Answers.LastEditDate: 2021-01-21T18:44:09.463Z
Answers.UserDisplayName: nbro
Body: <p>I am studying a knowledge base (KB) from the book &quot;Artificial Intelligence: A Modern Approach&quot; (by Stuart Russell and Peter Norvig) and from <a href="https://www.cs.princeton.edu/courses/archive/fall16/cos402/lectures/402-lec12.pdf" rel="nofollow noreferrer">this series of slides</a>.</p>
  <p>A formula is satisfiable if there is some assignment to the variables that makes the formula evaluate to true. For example, if we have the boolean formula <span class="math-container">$A \land B$</span>, then the assignments <span class="math-container">$A=\text{true}$</span> and <span class="math-container">$B=\text{true}$</span> make it satisfiable. Right?</p>
  <p>But what does it mean for a KB to be consistent? The definition (given at slide 14 of <a href="https://www.cs.princeton.edu/courses/archive/fall16/cos402/lectures/402-lec12.pdf" rel="nofollow noreferrer">this series of slides</a>) is:</p>
  <blockquote>
  <p>a KB is consistent with formula <span class="math-container">$f$</span> if <span class="math-container">$M(KB \cup \{ f \})$</span> is non-empty (there is a world in which KB is true and <span class="math-container">$f$</span> is also true).</p>
  </blockquote>
  <p>Can anyone explain this part to me with an example?</p>
  
Tags: <definitions><logic><knowledge-representation><norvig-russell><knowledge-base>
Title: When is a knowledge base consistent?
UserDisplayName: theantomc
ThreadText: # When is a knowledge base consistent?
  
  (Asked by: username_0 on 2019-02-09)
  
  I am studying a knowledge base (KB) from the book "Artificial Intelligence: A Modern Approach" (by Stuart Russell and Peter Norvig) and from [this series of slides](https://www.cs.princeton.edu/courses/archive/fall16/cos402/lectures/402-lec12.pdf).
  
  A formula is satisfiable if there is some assignment to the variables that makes the formula evaluate to true. For example, if we have the boolean formula $A \land B$, then the assignments $A=\text{true}$ and $B=\text{true}$ make it satisfiable. Right?
  
  But what does it mean for a KB to be consistent? The definition (given at slide 14 of [this series of slides](https://www.cs.princeton.edu/courses/archive/fall16/cos402/lectures/402-lec12.pdf)) is:
  
  > a KB is consistent with formula $f$ if $M(KB \cup \{ f \})$ is non-empty (there is a world in which KB is true and $f$ is also true).
  
  Can anyone explain this part to me with an example?
  
  **Tags:** definitions, logic, knowledge-representation, norvig-russell, knowledge-base
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-02-10. Score: 2 | Accepted answer
  
  I will first recapitulate the key concepts which you need to know in order to understand the answer to your question (which will be very simple, because I will just try to clarify what is given as a "definition").
  
  In logic, a **formula** is e.g. $f$, $\lnot f$, $f \land g$, where $f$ can be e.g. the **proposition** (or *variable*) "today it will rain". So, in a (propositional) formula, you have *propositions*, i.e. sentences like "today it will rain", and logical **connectives**, i.e. symbols like $\land$ (i.e. logical AND), which logically *connect* these sentences. The propositions like "today it will rain" can often be denoted by a single (capital) letter like $P$. $f \land g$ is the combination of two formulae (where *formulae* is the plural of *formula*). So, for example, suppose that $f$ is composed of the propositions "today it will rain" (denoted by $P$) *or* "my friend will visit me" (denoted by $Q$) and $f$ is defined as "I will play with my friend" (denoted by $S$). Then the formula $f \land g = (P \lor Q) \land S$. In general, you can combine formulae in any logically appropriate way.
  
  In this context, a **model** is an *assignment* to each variable in a formula. For example, suppose $f = P \lor Q$, then $w = \{ P=0, Q = 1\}$ is a *model* for $f$, that is, each variable (e.g. $P$) is assigned either "true" ($1$) or "false" ($0$) but *not* both. (Note that [the word *model* may be used to refer to different concepts depending on the context](https://ai.stackexchange.com/a/25460/2444); again, in this context, you can simply think of a model as *an assignment of values to the variables in a formula*.)
  
  Suppose now we define $I(f, w)$ to be a *function that receives the formula $f$ and the model $w$ as input, and $I$ returns either "true" ($1$) or "false" ($0$)*. In other words, $I$ is a function that *automatically* tells us if $f$ is evaluated to true or false given the assignment $w$.
  
  You can now define $M(f)$ to be a *set of assignments (or models) to the formula $f$ such that $f$ is true*. So, $M$ is a set and not just an assignment (or model). This set can be empty, it can contain one assignment or it can contain any number of assignments: it depends on the formula $f$: in some cases, $M$ is empty and, in other cases, it may contain say $n$ valid assignments to $f$, where by "valid" I mean that these assignments make $f$ evaluate to "true". For example, suppose we have formula $f = A \land \lnot A$. Then you can try to assign any value to $A$, but $f$ will never evaluate to true. In that case, $M(f)$ is an empty set, because there is no assignment to the variables (or propositions) of $f$ which make $f$ evaluate to true.
  
  A **knowledge base** is a set of formulae $\text{KB} = \{ f\_1, f\_2, \dots, f\_n \}$. So, for example, $f\_2 = $ "today it will rain" and $f\_3 = $ "I will go to school AND I will have lunch".
  
  We can now define $M(\text{KB})$ to be the *set of assignments to the formulae in the knowledge base $\text{KB}$ such that all formulae are true*. If you think of the formulae in $KB$ as "facts", $M(\text{KB})$ is an assignment to these formulae in $KB$ such that these facts hold or are true.
  
  In this context, we then say that a particular knowledge base (i.e., a set of formulae as defined above), denoted by $\text{KB}$, is *consistent with formula $f$ if $M(\text{KB} \cup \{ f \})$ is a non-empty set*, where $\cup$ means the *union* operation between sets: note that (as we defined it above) $\text{KB}$ is a set, and $\{ f \}$ means that we are making a set out of the formula $f$, so we are indeed performing an *union* operation on sets.
  
  So, what does it mean for a knowledge base to be consistent? First of all, the consistency of a knowledge base $\text{KB}$ is defined *with respect to* another formula $f$. Recall that a knowledge base is a set of formulae, so we are defining the consistency of a set of formulae with respect to another formula.
  
  When is then a knowledge base $\text{KB}$ consistent with a formula $f$? When $M(\text{KB} \cup \{ f \})$ is a non-empty set. Recall that $M$ is an assignment to the variables in its input such that its inputs evaluate to true. So, $\text{KB}$ is consistent with $f$ when there is a set of assignments of values to the formulae in $\text{KB}$ and an assignment of values to the variables in $f$ such that *both* $\text{KB}$ and $f$ are true. In other words, $\text{KB}$ is consistent with $f$ when both all formulae in $\text{KB}$ and $f$ can be true *at the same time*.
  
  
  ---
  
  ### Answer by username_1 on 2019-02-10. Score: 0
  
  Here is a (very) brief [wikipedia article on consistency in KB's](https://en.wikipedia.org/wiki/Consistency_(knowledge_bases)), which should answer your question.
  
  A KB is consistent, if it does not contain any contradictions, ie $\lnot a$ and $a$ are not both derivable from it. Which is pretty much common sense if you think about it.
  
  If I have a formula $f$, for example "A is a trout $\land$ A lays eggs", and my KB contains "fish lay eggs" and "a trout is a fish", then, if $f$ is true, ie trout do lay eggs, that formula is consistent with my KB, which states that trout are fish and that fish lay eggs.
  
  Edit: for a more formalised version, see username_2's answer.
  
  
  ---
  
  