In logic puzzles, knaves are characters who always lie. They are central to the 'knights and knaves' puzzle type, requiring…