Chop Logic Core - v1.8.3
    Preparing search index...

    Function isPropAtom

    • Type guard to check if a value is a PropAtom. A PropAtom is a tuple with exactly one string element representing an atomic proposition.

      Parameters

      • value: unknown

        The value to check

      Returns value is PropAtom

      True if the value is a PropAtom

      // Returns true for valid PropAtom
      isPropAtom(['p']); // true
      isPropAtom(['myVariable']); // true
      // Returns false for invalid values
      isPropAtom(['p', 'q']); // false - too many elements
      isPropAtom([]); // false - empty array
      isPropAtom([123]); // false - not a string
      isPropAtom({ operator: 'Var', values: ['p'] }); // false - PropFormula, not PropAtom