S4 is a modal logic system defined by reflexivity and transitivity axioms for its accessibility relation. This system implies that…