function TT-ENTAILS? (KB,α) returns true or false
inputs: KB, the knowledge base, a sentence in propositional logic
α, the query, a sentence in propositional logic
symbols <--- a list of the propositional symbols in KB and α
return TT-CHECK-ALL(KB,α,symbols,[])
function TT-CHECK-ALL(KB,α,symbols,model ) returns true or false
if EMPTY?(symbols) then
if PL-TRUE?(KB, model) then return PL-TRUE?(α,model)
else return true
else do
P <---FIRST(symbols); rest <--- REST(symbols)
return TT-CHECK-ALL(KB,α,rest,EXTEND(P,true,model) and
TT-CHECK-ALL(KB, α, rest, EXTEND(P,false,model)