Turn a story into truth constraints
A knights and knaves puzzle is a test of whether each speaker's assigned type agrees with the truth of that speaker's entire statement. A knight always makes a true statement, while a knave always makes a false one. Each person has exactly one of these two types under the usual convention.
Translate each statement
Treat an utterance as one complete proposition. Its truth value must match the speaker's type: true for a knight and false for a knave. Write down what the statement claims before deciding whether its speaker could say it.
For example, if D says that E is a knight, then D being a knight requires E to be a knight; D being a knave requires E to be a knave. This is a consistency constraint linking the two types. It does not independently tell you which type either person has.
Check the whole assignment
A type assignment gives every person one type. Test each speaker's full statement under that same assignment. Reject the assignment as soon as a knight's statement evaluates false or a knave's evaluates true, but check every speaker before accepting one.
A compound claim needs special care. A conjunction such as “X and Y” is false when either part is false, even if the other part is true. Thus a knave may say a sentence containing a true clause, provided the complete sentence is false.
Worked example
Suppose D says “E is a knight,” and E says “D is a knight.” Assign both to be knights: each statement is true, so the assignment works.
Assign both to be knaves: each statement is false, so that assignment also works. The two mixed assignments fail because one speaker's statement would have the wrong truth value. This puzzle therefore has two consistent assignments rather than a unique answer.
A says “B is a knight.” B says “A is a knave.” Under the usual knight and knave convention, which conclusion follows?
Exactly one of A, B, and C is a knight. A says “B is a knight.” B says “C is a knave.” C says “A is a knave.” Who is the knight?