docs: def rule_str2rule(rule_str, prob):
      # type: (str, float) -> Rule
      """
      A helper function that converts the resulting string returned from C function to the Rule object
  
      :param rule_str: a string representing the rule
      :param prob: the output probability
      :return: a Rule object
      """
      if rule_str == "default":
          return Rule([], prob)
  
      raw_rules = rule_str[1:-1].split(",")
      clauses = []
      for raw_rule in raw_rules:
          idx = raw_rule.find("=")
          if idx == -1:
              raise ValueError("No \"=\" find in the rule!")
          clauses.append(Clause(int(raw_rule[1:idx]), int(raw_rule[(idx + 1):])))
      return Rule(clauses, prob)