code: def z3_satisfiable(expr, all_models=False):
      if not isinstance(expr, EncodedCNF):
          exprs = EncodedCNF()
          exprs.add_prop(expr)
          expr = exprs
  
      z3 = import_module("z3")
      if z3 is None:
          raise ImportError("z3 is not installed")
  
      s = encoded_cnf_to_z3_solver(expr, z3)
  
      res = str(s.check())
      if res == "unsat":
          return False
      elif res == "sat":
          return True
      else:
          return None
  
file_path: sympy/sympy/logic/algorithms/z3_wrapper.py
imports: from sympy.printing.smtlib import smtlib_code
  from sympy.assumptions.assume import AppliedPredicate
  from sympy.assumptions.cnf import EncodedCNF
  from sympy.assumptions.ask import Q
  from sympy.core import Add, Mul
  from sympy.core.relational import Equality, LessThan, GreaterThan, StrictLessThan, StrictGreaterThan
  from sympy.functions.elementary.complexes import Abs
  from sympy.functions.elementary.exponential import Pow
  from sympy.functions.elementary.miscellaneous import Min, Max
  from sympy.logic.boolalg import And, Or, Xor, Implies
  from sympy.logic.boolalg import Not, ITE
  from sympy.assumptions.relation.equality import StrictGreaterThanPredicate, StrictLessThanPredicate, GreaterThanPredicate, LessThanPredicate, EqualityPredicate
  from sympy.external import import_module
label_desc: Use image node_id 1 for calling a global function with example usage: z3_satisfiable(expr, all_models) and returns: False, True, None