Skip to main content

Modal Logic Ontology

Modal Logic
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 17 September 2026
Audio Overview
FLOW_ALGEBRA ModalLogicOntologyDetailed v1.0

TARGET_URL := "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/mathematical-logic-ontologies/modal-logic/modal-logic-ontology.html"
LANGUAGE := "en-GB"
DOMAIN := MathematicalOntologies > MathematicalLogicOntologies > ModalLogic > ModalLogicOntology

BEGIN_FLOW

ENTITY ModalLogic {
    TYPE := FormalLogicalSystem
    DEFINITION := "A logical framework extending a base logic with operators that qualify truth according to modes such as necessity and possibility."
    CORE_OPERATORS := {NecessityOperator, PossibilityOperator}
}

ENTITY ModalFormula {
    TYPE := WellFormedFormula
}

ENTITY NecessityOperator {
    TYPE := ModalOperator
    SYMBOL := "□"
    READING := "necessarily"
}

ENTITY PossibilityOperator {
    TYPE := ModalOperator
    SYMBOL := "◇"
    READING := "possibly"
}

RELATIONSHIP ModalLogic --extends--> PropositionalLogic
RELATIONSHIP ModalLogic --may_extend--> PredicateLogic
RELATIONSHIP ModalLogic --contains--> ModalFormula
RELATIONSHIP NecessityOperator --dual_of--> PossibilityOperator
RELATIONSHIP ModalLogic --is_interpreted_by--> KripkeSemantics
RELATIONSHIP ModalLogic --can_be_axiomatised_by--> ModalProofSystem

SYNTAX {
    Formula :=
        AtomicProposition
        | ¬Formula
        | (Formula ∧ Formula)
        | (Formula ∨ Formula)
        | (Formula → Formula)
        | (Formula ↔ Formula)
        | □Formula
        | ◇Formula
}

MODAL_DUALITY {
    □P ≡ ¬◇¬P
    ◇P ≡ ¬□¬P
}

ENTITY KripkeFrame {
    TYPE := RelationalStructure
    FORM := (W,R)
    W := nonempty_set_of_worlds
    R := accessibility_relation_subset_of_W_cross_W
}

ENTITY KripkeModel {
    TYPE := SemanticModel
    FORM := (W,R,V)
    W := PossibleWorlds
    R := AccessibilityRelation
    V := Valuation
}

ENTITY PossibleWorld {
    TYPE := SemanticEvaluationPoint
}

ENTITY AccessibilityRelation {
    TYPE := BinaryRelation
    SIGNATURE := R ⊆ W × W
}

ENTITY Valuation {
    TYPE := AtomicTruthAssignment
    MAPPING := AtomicProposition -> SetOfWorldsWhereTrue
}

RELATIONSHIP KripkeFrame --contains--> PossibleWorld
RELATIONSHIP KripkeFrame --contains--> AccessibilityRelation
RELATIONSHIP KripkeModel --extends--> KripkeFrame
RELATIONSHIP KripkeModel --contains--> Valuation

SATISFACTION {
    M,w ⊨ p
        IFF w ∈ V(p)

    M,w ⊨ ¬P
        IFF NOT(M,w ⊨ P)

    M,w ⊨ P ∧ Q
        IFF M,w ⊨ P AND M,w ⊨ Q

    M,w ⊨ P ∨ Q
        IFF M,w ⊨ P OR M,w ⊨ Q

    M,w ⊨ P → Q
        IFF NOT(M,w ⊨ P) OR M,w ⊨ Q

    M,w ⊨ P ↔ Q
        IFF truth(M,w,P)=truth(M,w,Q)

    M,w ⊨ □P
        IFF FOR_ALL v:
            R(w,v) -> M,v ⊨ P

    M,w ⊨ ◇P
        IFF EXISTS v:
            R(w,v) AND M,v ⊨ P
}

NECESSITY {
    NECESSARY_AT(P,w) :=
        FOR_ALL v accessible_from w:
            P holds_at v
}

POSSIBILITY {
    POSSIBLE_AT(P,w) :=
        EXISTS v accessible_from w:
            P holds_at v
}

CONTINGENCY {
    CONTINGENT_AT(P,w) :=
        ◇P ∧ ◇¬P
}

IMPOSSIBILITY {
    IMPOSSIBLE_AT(P,w) :=
        ¬◇P
    EQUIVALENT := □¬P
}

MODAL_DEPTH(Formula F) {
    IF atomic(F)
        RETURN 0

    IF F = BooleanConnective(F1,...,Fn)
        RETURN MAX(MODAL_DEPTH(F1),...,MODAL_DEPTH(Fn))

    IF F = □P OR F = ◇P
        RETURN 1 + MODAL_DEPTH(P)
}

NORMAL_MODAL_LOGIC {
    REQUIRE := {
        PropositionalTautologies,
        AxiomK,
        ModusPonens,
        Necessitation
    }
}

AXIOM_K {
    FORMULA := □(P → Q) → (□P → □Q)
}

RULE_NECESSITATION {
    FROM theorem P
    INFER □P
}

AXIOM_T {
    FORMULA := □P → P
    FRAME_PROPERTY := Reflexive
}

AXIOM_D {
    FORMULA := □P → ◇P
    FRAME_PROPERTY := Serial
}

AXIOM_4 {
    FORMULA := □P → □□P
    FRAME_PROPERTY := Transitive
}

AXIOM_B {
    FORMULA := P → □◇P
    FRAME_PROPERTY := Symmetric
}

AXIOM_5 {
    FORMULA := ◇P → □◇P
    FRAME_PROPERTY := Euclidean
}

FRAME_REFLEXIVE {
    FOR_ALL w:
        R(w,w)
}

FRAME_SERIAL {
    FOR_ALL w:
        EXISTS v:
            R(w,v)
}

FRAME_SYMMETRIC {
    FOR_ALL w,v:
        R(w,v) -> R(v,w)
}

FRAME_TRANSITIVE {
    FOR_ALL w,v,u:
        (R(w,v) AND R(v,u)) -> R(w,u)
}

FRAME_EUCLIDEAN {
    FOR_ALL w,v,u:
        (R(w,v) AND R(w,u)) -> R(v,u)
}

MODAL_SYSTEMS {
    K {
        AXIOMS := {K}
        FRAME_CLASS := AllKripkeFrames
    }

    D {
        EXTENDS := K
        ADD := D
        FRAME_CLASS := SerialFrames
    }

    T {
        EXTENDS := K
        ADD := T
        FRAME_CLASS := ReflexiveFrames
    }

    K4 {
        EXTENDS := K
        ADD := 4
        FRAME_CLASS := TransitiveFrames
    }

    S4 {
        EXTENDS := K
        ADD := {T,4}
        FRAME_CLASS := ReflexiveTransitiveFrames
    }

    S5 {
        EXTENDS := K
        ADD := {T,5}
        FRAME_CLASS := EquivalenceRelationFrames
    }
}

MODEL_CHECK(Model M, World w, Formula F) {
    IF F atomic:
        RETURN w ∈ V(F)

    IF F = ¬P:
        RETURN NOT MODEL_CHECK(M,w,P)

    IF F = P ∧ Q:
        RETURN MODEL_CHECK(M,w,P)
               AND MODEL_CHECK(M,w,Q)

    IF F = P ∨ Q:
        RETURN MODEL_CHECK(M,w,P)
               OR MODEL_CHECK(M,w,Q)

    IF F = P → Q:
        RETURN NOT MODEL_CHECK(M,w,P)
               OR MODEL_CHECK(M,w,Q)

    IF F = P ↔ Q:
        RETURN MODEL_CHECK(M,w,P)
               = MODEL_CHECK(M,w,Q)

    IF F = □P:
        FOR_ALL v WHERE R(w,v):
            IF NOT MODEL_CHECK(M,v,P)
                RETURN FALSE
        RETURN TRUE

    IF F = ◇P:
        FOR_EACH v WHERE R(w,v):
            IF MODEL_CHECK(M,v,P)
                RETURN TRUE
        RETURN FALSE
}

SATISFIABILITY {
    SATISFIABLE(F) :=
        EXISTS model M
        EXISTS world w:
            M,w ⊨ F

    UNSATISFIABLE(F) :=
        NOT SATISFIABLE(F)
}

VALIDITY {
    VALID_IN_MODEL(M,F) :=
        FOR_ALL worlds w:
            M,w ⊨ F

    VALID_ON_FRAME(K,F) :=
        FOR_ALL valuations V:
            (K,V) satisfies F at every world

    VALID_IN_LOGIC(L,F) :=
        FOR_ALL frames K IN FrameClass(L):
            VALID_ON_FRAME(K,F)
}

COUNTERMODEL_SEARCH(Formula F, Logic L) {
    SEARCH frames K IN FrameClass(L)
    SEARCH valuations V
    SEARCH worlds w

    IF (K,V),w ⊭ F
        RETURN Countermodel(K,V,w)

    RETURN no_countermodel_found_within_search
}

SEMANTIC_ENTAILMENT {
    Γ ⊨_L F
        IFF every L-model/world satisfying Γ
        also satisfies F
}

SYNTACTIC_DERIVABILITY {
    Γ ⊢_L F
        IFF F is derivable using the axioms and rules of L
}

SOUNDNESS {
    IF Γ ⊢_L F
    THEN Γ ⊨_L F
}

COMPLETENESS {
    IF Γ ⊨_L F
    THEN Γ ⊢_L F

    REQUIRE :=
        specified_modal_system_and_matching_semantics
}

BISIMULATION {
    GIVEN models M1,M2
    GIVEN relation Z

    REQUIRE := {
        AtomicHarmony,
        Forth,
        Back
    }

    CONSEQUENCE :=
        related points satisfy the same basic modal formulae
}

ATOMIC_HARMONY {
    IF Z(w,v)
    THEN FOR_ALL atomic p:
        M1,w ⊨ p IFF M2,v ⊨ p
}

FORTH {
    IF Z(w,v) AND R1(w,w1)
    THEN EXISTS v1:
        R2(v,v1) AND Z(w1,v1)
}

BACK {
    IF Z(w,v) AND R2(v,v1)
    THEN EXISTS w1:
        R1(w,w1) AND Z(w1,v1)
}

MODAL_EQUIVALENCE {
    w ≡_ML v
    IFF w and v satisfy the same modal formulae
}

FRAME_CORRESPONDENCE {
    T <-> Reflexivity
    D <-> Seriality
    4 <-> Transitivity
    B <-> Symmetry
    5 <-> EuclideanProperty
}

NESTED_MODALITIES {
    □□P := necessarily_necessarily_P
    ◇◇P := possibly_possibly_P
    □◇P := necessarily_possible_P
    ◇□P := possibly_necessary_P

    INTERPRETATION_DEPENDS_ON :=
        AccessibilityStructure
}

MULTIMODAL_LOGIC {
    MODALITIES := {□_i,◇_i}
    EACH modality_i HAS AccessibilityRelation R_i
}

FIRST_ORDER_MODAL_LOGIC {
    BASE := PredicateLogic
    ADD := ModalOperators

    SEMANTIC_COMPONENTS_MAY_INCLUDE := {
        IndividualDomains,
        VariableAssignments,
        QuantifierSemantics,
        DomainVariation
    }

    REQUIRE :=
        explicit assumptions for quantifier-modal interaction
}

TEMPORAL_RELATIONSHIP {
    ModalLogic --specialises_into--> TemporalLogic
}

EPISTEMIC_RELATIONSHIP {
    ModalLogic --specialises_into--> EpistemicLogic
    □_a P := knowledge_or_belief_modality_under_selected_semantics
}

DEONTIC_RELATIONSHIP {
    ModalLogic --specialises_into--> DeonticLogic
    □P := obligation_under_selected_semantics
    ◇P := permission_under_selected_semantics
}

DYNAMIC_RELATIONSHIP {
    ModalLogic --specialises_into--> DynamicLogic
    [α]P := universal_action_modality
    <α>P := existential_action_modality
}

APPLICATION_RELATIONSHIPS {
    ModalLogic --supports--> FormalVerification
    ModalLogic --supports--> ModelChecking
    ModalLogic --supports--> KnowledgeRepresentation
    ModalLogic --supports--> MultiAgentReasoning
    ModalLogic --supports--> TemporalReasoning
    ModalLogic --supports--> ProgramReasoning
    ModalLogic --supports--> ArtificialIntelligence
    ModalLogic --supports--> PhilosophicalLogic
}

ONTOLOGY_LINKS {
    PARENT := ModalLogic

    RELATED := {
        PropositionalLogicOntology,
        PredicateLogicOntology,
        ModelTheoryOntology,
        ProofTheoryOntology,
        RelationOntology,
        TemporalLogicOntology,
        EpistemicLogicOntology,
        DeonticLogicOntology,
        DynamicLogicOntology,
        PossibleWorldOntology,
        KripkeFrameOntology,
        KripkeModelOntology
    }
}

SEMANTIC_EQUIVALENCE {
    □P ≈ Necessarily(P)
    ◇P ≈ Possibly(P)
    □P ≈ ¬◇¬P
    ◇P ≈ ¬□¬P

    KripkeWorld ≈ PossibleWorld
        WHEN context=KripkeSemantics

    R(w,v) ≈ v_is_accessible_from_w
        WHEN context=KripkeFrame
}

CONSTRAINTS {
    C1 :=
        modal system or semantic framework MUST be identified for system-specific conclusions

    C2 :=
        □P at w MUST quantify over all R-accessible worlds from w

    C3 :=
        ◇P at w MUST require at least one R-accessible world satisfying P

    C4 :=
        possibility MUST NOT be conflated with numerical probability

    C5 :=
        local necessity MUST NOT automatically be conflated with global validity

    C6 :=
        frame-property correspondences MUST preserve their intended Kripke-semantic assumptions

    C7 :=
        distinct modal systems MUST retain distinct axiom and frame specifications

    C8 :=
        first-order modal reasoning MUST state relevant domain assumptions

    C9 :=
        bisimulation claims MUST satisfy atomic harmony, forth and back

    C10 :=
        transformations MUST preserve truth under the selected modal semantics
}

REASONING_CHAIN Query Q {
    IDENTIFY target_modal_concept
    IDENTIFY formula
    IDENTIFY base_logic
    IDENTIFY modal_system
    IDENTIFY semantic_framework

    PARSE formula
    IDENTIFY modal_operators
    COMPUTE modal_depth
    RESOLVE modal_dualities

    IF KripkeModel_provided {
        EXTRACT worlds
        EXTRACT accessibility_relation
        EXTRACT valuation
        VALIDATE model_structure
    }

    IF model_check_requested
        THEN MODEL_CHECK

    IF satisfiability_requested
        THEN search_for_satisfying_model

    IF validity_requested
        THEN evaluate_over_selected_frame_class

    IF theoremhood_requested
        THEN attempt_derivation_in_selected_system

    IF countermodel_requested
        THEN COUNTERMODEL_SEARCH

    IF frame_correspondence_requested
        THEN FRAME_CORRESPONDENCE

    IF bisimulation_requested
        THEN CHECK {AtomicHarmony,Forth,Back}

    IF multimodal_context
        THEN distinguish_modal_indices_and_relations

    IF first_order_modal_context
        THEN identify_domain_and_quantifier_semantics

    VALIDATE constraints
    RETURN result WITH derivation
}

CONFIDENCE {
    CORE_MODAL_SYNTAX := 1.00
    NECESSITY_POSSIBILITY_DUALITY := 1.00
    KRIPKE_SEMANTICS := 1.00
    STANDARD_MODAL_SYSTEM_DEFINITIONS := 0.99
    FRAME_CORRESPONDENCES := 0.99

    MODEL_CHECKING :=
        IF complete_model_given THEN 1.00
        ELSE REQUIRE missing_information

    SYSTEM_SPECIFIC_INFERENCE :=
        REQUIRE modal_system_identification
}

UPDATE_MODEL {
    IMMUTABLE_CORE := {
        ModalOperators,
        NecessityPossibilityDuality,
        KripkeFrameStructure,
        KripkeModelStructure,
        SatisfactionSemantics
    }

    EXTENSIBLE := {
        ModalSystems,
        FrameClasses,
        ProofCalculi,
        AlternativeSemantics,
        MultimodalExtensions,
        FirstOrderModalExtensions,
        ApplicationDomains,
        RelatedOntologies
    }

    ON_NEW_KNOWLEDGE {
        IDENTIFY semantic_scope
        VALIDATE modal_syntax
        VALIDATE frame_conditions
        CHECK system_compatibility
        CHECK semantic_consistency
        ADD relationship IF non_contradictory
        UPDATE confidence
    }
}

AI_CONSUMPTION {
    MACHINE_READABLE := TRUE
    HUMAN_INTERPRETABLE := TRUE
    RECURSIVE_REASONING := TRUE
    ENTITY_RESOLUTION := TRUE
    SYMBOL_RESOLUTION := TRUE
    RELATIONSHIP_TRAVERSAL := TRUE
    POSSIBLE_WORLD_REASONING := TRUE
    ACCESSIBILITY_REASONING := TRUE
    MODEL_CHECKING := TRUE
    SATISFIABILITY_REASONING := TRUE
    COUNTERMODEL_REASONING := TRUE
    BISIMULATION_REASONING := TRUE
    FRAME_CORRESPONDENCE_REASONING := TRUE
    VALIDATION_REQUIRED := TRUE
}

FLOW_HASH {
    TARGET := TARGET_URL
    SUBJECT := "Modal Logic Ontology"
    VERSION := "1.0"
    CANONICAL_SIGNATURE :=
        HASH(TARGET + SUBJECT + DOMAIN + VERSION)
}

OUTPUT {
    PRIMARY_ENTITY := ModalLogic

    INTERPRETATION :=
        "Modal logic extends ordinary truth-functional reasoning with necessity and possibility. In relational Kripke semantics, formulae are evaluated at worlds connected by accessibility relations, enabling formal reasoning about modal truth, frame structure, validity, satisfiability, equivalence and specialised modal systems."
}

END_FLOW
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ