code: def get_known_facts_dict():
      """
      Logical relations between unary predicates as dictionary.
  
      Each key is a predicate, and item is two groups of predicates.
      First group contains the predicates which are implied by the key, and
      second group contains the predicates which are rejected by the key.
  
      """
      return {
          Q.algebraic: (
              set([Q.algebraic, Q.commutative, Q.complex, Q.finite]),
              set(
                  [
                      Q.infinite,
                      Q.negative_infinite,
                      Q.positive_infinite,
                      Q.transcendental,
                  ]
              ),
          ),
          Q.antihermitian: (set([Q.antihermitian]), set([])),
          Q.commutative: (set([Q.commutative]), set([])),
          Q.complex: (
              set([Q.commutative, Q.complex, Q.finite]),
              set(
                  [Q.infinite, Q.negative_infinite, Q.positive_infinite]
              ),
          ),
          Q.complex_elements: (set([Q.complex_elements]), set([])),
          Q.composite: (
              set(
                  [
                      Q.algebraic,
                      Q.commutative,
                      Q.complex,
                      Q.composite,
                      Q.extended_nonnegative,
                      Q.extended_nonzero,
                      Q.extended_positive,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.integer,
                      Q.nonnegative,
                      Q.nonzero,
                      Q.positive,
                      Q.rational,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.extended_negative,
                      Q.extended_nonpositive,
                      Q.imaginary,
                      Q.infinite,
                      Q.irrational,
                      Q.negative,
                      Q.negative_infinite,
                      Q.nonpositive,
                      Q.positive_infinite,
                      Q.prime,
                      Q.transcendental,
                      Q.zero,
                  ]
              ),
          ),
          Q.diagonal: (
              set(
                  [
                      Q.diagonal,
                      Q.lower_triangular,
                      Q.normal,
                      Q.square,
                      Q.symmetric,
                      Q.triangular,
                      Q.upper_triangular,
                  ]
              ),
              set([]),
          ),
          Q.even: (
              set(
                  [
                      Q.algebraic,
                      Q.commutative,
                      Q.complex,
                      Q.even,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.integer,
                      Q.rational,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.imaginary,
                      Q.infinite,
                      Q.irrational,
                      Q.negative_infinite,
                      Q.odd,
                      Q.positive_infinite,
                      Q.transcendental,
                  ]
              ),
          ),
          Q.extended_negative: (
              set(
                  [
                      Q.commutative,
                      Q.extended_negative,
                      Q.extended_nonpositive,
                      Q.extended_nonzero,
                      Q.extended_real,
                  ]
              ),
              set(
                  [
                      Q.composite,
                      Q.extended_nonnegative,
                      Q.extended_positive,
                      Q.imaginary,
                      Q.nonnegative,
                      Q.positive,
                      Q.positive_infinite,
                      Q.prime,
                      Q.zero,
                  ]
              ),
          ),
          Q.extended_nonnegative: (
              set(
                  [
                      Q.commutative,
                      Q.extended_nonnegative,
                      Q.extended_real,
                  ]
              ),
              set(
                  [
                      Q.extended_negative,
                      Q.imaginary,
                      Q.negative,
                      Q.negative_infinite,
                  ]
              ),
          ),
          Q.extended_nonpositive: (
              set(
                  [
                      Q.commutative,
                      Q.extended_nonpositive,
                      Q.extended_real,
                  ]
              ),
              set(
                  [
                      Q.composite,
                      Q.extended_positive,
                      Q.imaginary,
                      Q.positive,
                      Q.positive_infinite,
                      Q.prime,
                  ]
              ),
          ),
          Q.extended_nonzero: (
              set([Q.commutative, Q.extended_nonzero, Q.extended_real]),
              set([Q.imaginary, Q.zero]),
          ),
          Q.extended_positive: (
              set(
                  [
                      Q.commutative,
                      Q.extended_nonnegative,
                      Q.extended_nonzero,
                      Q.extended_positive,
                      Q.extended_real,
                  ]
              ),
              set(
                  [
                      Q.extended_negative,
                      Q.extended_nonpositive,
                      Q.imaginary,
                      Q.negative,
                      Q.negative_infinite,
                      Q.nonpositive,
                      Q.zero,
                  ]
              ),
          ),
          Q.extended_real: (
              set([Q.commutative, Q.extended_real]),
              set([Q.imaginary]),
          ),
          Q.finite: (
              set([Q.commutative, Q.finite]),
              set(
                  [Q.infinite, Q.negative_infinite, Q.positive_infinite]
              ),
          ),
          Q.fullrank: (set([Q.fullrank]), set([])),
          Q.hermitian: (set([Q.hermitian]), set([])),
          Q.imaginary: (
              set(
                  [
                      Q.antihermitian,
                      Q.commutative,
                      Q.complex,
                      Q.finite,
                      Q.imaginary,
                  ]
              ),
              set(
                  [
                      Q.composite,
                      Q.even,
                      Q.extended_negative,
                      Q.extended_nonnegative,
                      Q.extended_nonpositive,
                      Q.extended_nonzero,
                      Q.extended_positive,
                      Q.extended_real,
                      Q.infinite,
                      Q.integer,
                      Q.irrational,
                      Q.negative,
                      Q.negative_infinite,
                      Q.nonnegative,
                      Q.nonpositive,
                      Q.nonzero,
                      Q.odd,
                      Q.positive,
                      Q.positive_infinite,
                      Q.prime,
                      Q.rational,
                      Q.real,
                      Q.zero,
                  ]
              ),
          ),
          Q.infinite: (
              set([Q.commutative, Q.infinite]),
              set(
                  [
                      Q.algebraic,
                      Q.complex,
                      Q.composite,
                      Q.even,
                      Q.finite,
                      Q.imaginary,
                      Q.integer,
                      Q.irrational,
                      Q.negative,
                      Q.nonnegative,
                      Q.nonpositive,
                      Q.nonzero,
                      Q.odd,
                      Q.positive,
                      Q.prime,
                      Q.rational,
                      Q.real,
                      Q.transcendental,
                      Q.zero,
                  ]
              ),
          ),
          Q.integer: (
              set(
                  [
                      Q.algebraic,
                      Q.commutative,
                      Q.complex,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.integer,
                      Q.rational,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.imaginary,
                      Q.infinite,
                      Q.irrational,
                      Q.negative_infinite,
                      Q.positive_infinite,
                      Q.transcendental,
                  ]
              ),
          ),
          Q.integer_elements: (
              set(
                  [
                      Q.complex_elements,
                      Q.integer_elements,
                      Q.real_elements,
                  ]
              ),
              set([]),
          ),
          Q.invertible: (
              set([Q.fullrank, Q.invertible, Q.square]),
              set([Q.singular]),
          ),
          Q.irrational: (
              set(
                  [
                      Q.commutative,
                      Q.complex,
                      Q.extended_nonzero,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.irrational,
                      Q.nonzero,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.composite,
                      Q.even,
                      Q.imaginary,
                      Q.infinite,
                      Q.integer,
                      Q.negative_infinite,
                      Q.odd,
                      Q.positive_infinite,
                      Q.prime,
                      Q.rational,
                      Q.zero,
                  ]
              ),
          ),
          Q.is_true: (set([Q.is_true]), set([])),
          Q.lower_triangular: (
              set([Q.lower_triangular, Q.triangular]),
              set([]),
          ),
          Q.negative: (
              set(
                  [
                      Q.commutative,
                      Q.complex,
                      Q.extended_negative,
                      Q.extended_nonpositive,
                      Q.extended_nonzero,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.negative,
                      Q.nonpositive,
                      Q.nonzero,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.composite,
                      Q.extended_nonnegative,
                      Q.extended_positive,
                      Q.imaginary,
                      Q.infinite,
                      Q.negative_infinite,
                      Q.nonnegative,
                      Q.positive,
                      Q.positive_infinite,
                      Q.prime,
                      Q.zero,
                  ]
              ),
          ),
          Q.negative_infinite: (
              set(
                  [
                      Q.commutative,
                      Q.extended_negative,
                      Q.extended_nonpositive,
                      Q.extended_nonzero,
                      Q.extended_real,
                      Q.infinite,
                      Q.negative_infinite,
                  ]
              ),
              set(
                  [
                      Q.algebraic,
                      Q.complex,
                      Q.composite,
                      Q.even,
                      Q.extended_nonnegative,
                      Q.extended_positive,
                      Q.finite,
                      Q.imaginary,
                      Q.integer,
                      Q.irrational,
                      Q.negative,
                      Q.nonnegative,
                      Q.nonpositive,
                      Q.nonzero,
                      Q.odd,
                      Q.positive,
                      Q.positive_infinite,
                      Q.prime,
                      Q.rational,
                      Q.real,
                      Q.transcendental,
                      Q.zero,
                  ]
              ),
          ),
          Q.noninteger: (set([Q.noninteger]), set([])),
          Q.nonnegative: (
              set(
                  [
                      Q.commutative,
                      Q.complex,
                      Q.extended_nonnegative,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.nonnegative,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.extended_negative,
                      Q.imaginary,
                      Q.infinite,
                      Q.negative,
                      Q.negative_infinite,
                      Q.positive_infinite,
                  ]
              ),
          ),
          Q.nonpositive: (
              set(
                  [
                      Q.commutative,
                      Q.complex,
                      Q.extended_nonpositive,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.nonpositive,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.composite,
                      Q.extended_positive,
                      Q.imaginary,
                      Q.infinite,
                      Q.negative_infinite,
                      Q.positive,
                      Q.positive_infinite,
                      Q.prime,
                  ]
              ),
          ),
          Q.nonzero: (
              set(
                  [
                      Q.commutative,
                      Q.complex,
                      Q.extended_nonzero,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.nonzero,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.imaginary,
                      Q.infinite,
                      Q.negative_infinite,
                      Q.positive_infinite,
                      Q.zero,
                  ]
              ),
          ),
          Q.normal: (set([Q.normal, Q.square]), set([])),
          Q.odd: (
              set(
                  [
                      Q.algebraic,
                      Q.commutative,
                      Q.complex,
                      Q.extended_nonzero,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.integer,
                      Q.nonzero,
                      Q.odd,
                      Q.rational,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.even,
                      Q.imaginary,
                      Q.infinite,
                      Q.irrational,
                      Q.negative_infinite,
                      Q.positive_infinite,
                      Q.transcendental,
                      Q.zero,
                  ]
              ),
          ),
          Q.orthogonal: (
              set(
                  [
                      Q.fullrank,
                      Q.invertible,
                      Q.normal,
                      Q.orthogonal,
                      Q.positive_definite,
                      Q.square,
                      Q.unitary,
                  ]
              ),
              set([Q.singular]),
          ),
          Q.positive: (
              set(
                  [
                      Q.commutative,
                      Q.complex,
                      Q.extended_nonnegative,
                      Q.extended_nonzero,
                      Q.extended_positive,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.nonnegative,
                      Q.nonzero,
                      Q.positive,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.extended_negative,
                      Q.extended_nonpositive,
                      Q.imaginary,
                      Q.infinite,
                      Q.negative,
                      Q.negative_infinite,
                      Q.nonpositive,
                      Q.positive_infinite,
                      Q.zero,
                  ]
              ),
          ),
          Q.positive_definite: (
              set(
                  [
                      Q.fullrank,
                      Q.invertible,
                      Q.positive_definite,
                      Q.square,
                  ]
              ),
              set([Q.singular]),
          ),
          Q.positive_infinite: (
              set(
                  [
                      Q.commutative,
                      Q.extended_nonnegative,
                      Q.extended_nonzero,
                      Q.extended_positive,
                      Q.extended_real,
                      Q.infinite,
                      Q.positive_infinite,
                  ]
              ),
              set(
                  [
                      Q.algebraic,
                      Q.complex,
                      Q.composite,
                      Q.even,
                      Q.extended_negative,
                      Q.extended_nonpositive,
                      Q.finite,
                      Q.imaginary,
                      Q.integer,
                      Q.irrational,
                      Q.negative,
                      Q.negative_infinite,
                      Q.nonnegative,
                      Q.nonpositive,
                      Q.nonzero,
                      Q.odd,
                      Q.positive,
                      Q.prime,
                      Q.rational,
                      Q.real,
                      Q.transcendental,
                      Q.zero,
                  ]
              ),
          ),
          Q.prime: (
              set(
                  [
                      Q.algebraic,
                      Q.commutative,
                      Q.complex,
                      Q.extended_nonnegative,
                      Q.extended_nonzero,
                      Q.extended_positive,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.integer,
                      Q.nonnegative,
                      Q.nonzero,
                      Q.positive,
                      Q.prime,
                      Q.rational,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.composite,
                      Q.extended_negative,
                      Q.extended_nonpositive,
                      Q.imaginary,
                      Q.infinite,
                      Q.irrational,
                      Q.negative,
                      Q.negative_infinite,
                      Q.nonpositive,
                      Q.positive_infinite,
                      Q.transcendental,
                      Q.zero,
                  ]
              ),
          ),
          Q.rational: (
              set(
                  [
                      Q.algebraic,
                      Q.commutative,
                      Q.complex,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.rational,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.imaginary,
                      Q.infinite,
                      Q.irrational,
                      Q.negative_infinite,
                      Q.positive_infinite,
                      Q.transcendental,
                  ]
              ),
          ),
          Q.real: (
              set(
                  [
                      Q.commutative,
                      Q.complex,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.real,
                  ]
              ),
              set(
                  [
                      Q.imaginary,
                      Q.infinite,
                      Q.negative_infinite,
                      Q.positive_infinite,
                  ]
              ),
          ),
          Q.real_elements: (
              set([Q.complex_elements, Q.real_elements]),
              set([]),
          ),
          Q.singular: (
              set([Q.singular]),
              set(
                  [
                      Q.invertible,
                      Q.orthogonal,
                      Q.positive_definite,
                      Q.unitary,
                  ]
              ),
          ),
          Q.square: (set([Q.square]), set([])),
          Q.symmetric: (set([Q.square, Q.symmetric]), set([])),
          Q.transcendental: (
              set(
                  [Q.commutative, Q.complex, Q.finite, Q.transcendental]
              ),
              set(
                  [
                      Q.algebraic,
                      Q.composite,
                      Q.even,
                      Q.infinite,
                      Q.integer,
                      Q.negative_infinite,
                      Q.odd,
                      Q.positive_infinite,
                      Q.prime,
                      Q.rational,
                      Q.zero,
                  ]
              ),
          ),
          Q.triangular: (set([Q.triangular]), set([])),
          Q.unit_triangular: (
              set([Q.triangular, Q.unit_triangular]),
              set([]),
          ),
          Q.unitary: (
              set(
                  [
                      Q.fullrank,
                      Q.invertible,
                      Q.normal,
                      Q.square,
                      Q.unitary,
                  ]
              ),
              set([Q.singular]),
          ),
          Q.upper_triangular: (
              set([Q.triangular, Q.upper_triangular]),
              set([]),
          ),
          Q.zero: (
              set(
                  [
                      Q.algebraic,
                      Q.commutative,
                      Q.complex,
                      Q.even,
                      Q.extended_nonnegative,
                      Q.extended_nonpositive,
                      Q.extended_real,
                      Q.finite,
                      Q.hermitian,
                      Q.integer,
                      Q.nonnegative,
                      Q.nonpositive,
                      Q.rational,
                      Q.real,
                      Q.zero,
                  ]
              ),
              set(
                  [
                      Q.composite,
                      Q.extended_negative,
                      Q.extended_nonzero,
                      Q.extended_positive,
                      Q.imaginary,
                      Q.infinite,
                      Q.irrational,
                      Q.negative,
                      Q.negative_infinite,
                      Q.nonzero,
                      Q.odd,
                      Q.positive,
                      Q.positive_infinite,
                      Q.prime,
                      Q.transcendental,
                  ]
              ),
          ),
      }
  
imports: from sympy.assumptions.ask import Q
  from sympy.assumptions.cnf import Literal
  from sympy.core.cache import cacheit
label_desc: Use image node_id 4 for calling a global function with example usage: get_known_facts_dict() and returns: dict