Class PossibleWorlds<W,P>

java.lang.Object
org.episteme.core.mathematics.logic.modal.PossibleWorlds<W,P>

public class PossibleWorlds<W,P> extends Object
Represents possible worlds semantics for modal logic.

In possible worlds semantics, modal operators are interpreted relative to accessibility relations between worlds. A proposition is necessarily true if it's true in all accessible worlds, and possibly true if it's true in at least one accessible world.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty possible worlds model.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAccessibility(W from, W to)
    Adds an accessibility relation between two worlds.
    void
    addWorld(W world)
    Adds a world to the model.
    Returns all worlds accessible from the given world.
    Returns all worlds in the model.
    boolean
    getValue(W world, P proposition)
    Gets the truth value of a proposition in a world.
    boolean
    isNecessary(W world, P proposition)
    Checks if a proposition is necessarily true in a world (true in all accessible worlds).
    boolean
    isPossible(W world, P proposition)
    Checks if a proposition is possibly true in a world (true in at least one accessible world).
    boolean
    Checks if the accessibility relation is reflexive (every world accesses itself).
    boolean
    Checks if the accessibility relation is symmetric (if w1 accesses w2, then w2 accesses w1).
    boolean
    Checks if the accessibility relation is transitive (if w1 accesses w2 and w2 accesses w3, then w1 accesses w3).
    void
    setValue(W world, P proposition, boolean value)
    Sets the truth value of a proposition in a world.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PossibleWorlds

      public PossibleWorlds()
      Creates an empty possible worlds model.
  • Method Details

    • addWorld

      public void addWorld(W world)
      Adds a world to the model.
      Parameters:
      world - the world to add
    • addAccessibility

      public void addAccessibility(W from, W to)
      Adds an accessibility relation between two worlds.
      Parameters:
      from - the source world
      to - the target world
    • setValue

      public void setValue(W world, P proposition, boolean value)
      Sets the truth value of a proposition in a world.
      Parameters:
      world - the world
      proposition - the proposition
      value - the truth value
    • getValue

      public boolean getValue(W world, P proposition)
      Gets the truth value of a proposition in a world.
      Parameters:
      world - the world
      proposition - the proposition
      Returns:
      the truth value, or false if not set
    • isNecessary

      public boolean isNecessary(W world, P proposition)
      Checks if a proposition is necessarily true in a world (true in all accessible worlds).
      Parameters:
      world - the world
      proposition - the proposition
      Returns:
      true if necessarily true
    • isPossible

      public boolean isPossible(W world, P proposition)
      Checks if a proposition is possibly true in a world (true in at least one accessible world).
      Parameters:
      world - the world
      proposition - the proposition
      Returns:
      true if possibly true
    • getAccessibleWorlds

      public Set<W> getAccessibleWorlds(W world)
      Returns all worlds accessible from the given world.
      Parameters:
      world - the world
      Returns:
      the set of accessible worlds
    • getAllWorlds

      public Set<W> getAllWorlds()
      Returns all worlds in the model.
      Returns:
      the set of all worlds
    • isReflexive

      public boolean isReflexive()
      Checks if the accessibility relation is reflexive (every world accesses itself).
      Returns:
      true if reflexive
    • isSymmetric

      public boolean isSymmetric()
      Checks if the accessibility relation is symmetric (if w1 accesses w2, then w2 accesses w1).
      Returns:
      true if symmetric
    • isTransitive

      public boolean isTransitive()
      Checks if the accessibility relation is transitive (if w1 accesses w2 and w2 accesses w3, then w1 accesses w3).
      Returns:
      true if transitive
    • toString

      public String toString()
      Overrides:
      toString in class Object