class_docstr: A ``MaceCommand`` specific to the ``Mace`` model builder.  It contains
  a print_assumptions() method that is used to print the list
  of assumptions in multiple formats.
class_docstr_tok: ["A","``","MaceCommand","``","specific","to","the","``","Mace","``","model","builder",".","It","contains","a","print_assumptions","(",")","method","that","is","used","to","print","the","list","of","assumptions","in","multiple","formats","."]
docstr: Transform the output file into an NLTK-style Valuation.
  
  :return: A model if one is generated; None otherwise.
  :rtype: sem.Valuation
docstr_tok: ["Transform","the","output","file","into","an","NLTK-style","Valuation",".",":","return",":","A","model","if","one","is","generated",";","None","otherwise",".",":","rtype",":","sem.Valuation"]
code: def _convert2val(self, valuation_str):
      """
      Transform the output file into an NLTK-style Valuation.
  
      :return: A model if one is generated; None otherwise.
      :rtype: sem.Valuation
      """
      valuation_standard_format = self._transform_output(
          valuation_str, "standard"
      )
  
      val = []
      for line in valuation_standard_format.splitlines(False):
          l = line.strip()
  
          if l.startswith("interpretation"):
              # find the number of entities in the model
              num_entities = int(
                  l[l.index("(") + 1 : l.index(",")].strip()
              )
  
          elif l.startswith("function") and l.find("_") == -1:
              # replace the integer identifier with a corresponding alphabetic character
              name = l[l.index("(") + 1 : l.index(",")].strip()
              if is_indvar(name):
                  name = name.upper()
              value = int(l[l.index("[") + 1 : l.index("]")].strip())
              val.append((name, MaceCommand._make_model_var(value)))
  
          elif l.startswith("relation"):
              l = l[l.index("(") + 1 :]
              if "(" in l:
                  # relation is not nullary
                  name = l[: l.index("(")].strip()
                  values = [
                      int(v.strip())
                      for v in l[l.index("[") + 1 : l.index("]")].split(
                          ","
                      )
                  ]
                  val.append(
                      (
                          name,
                          MaceCommand._make_relation_set(
                              num_entities, values
                          ),
                      )
                  )
              else:
                  # relation is nullary
                  name = l[: l.index(",")].strip()
                  value = int(
                      l[l.index("[") + 1 : l.index("]")].strip()
                  )
                  val.append((name, value == 1))
  
      return Valuation(val)
  
imports: import os
  import tempfile
  from nltk.inference.api import BaseModelBuilderCommand, ModelBuilder
  from nltk.inference.prover9 import Prover9CommandParent, Prover9Parent
  from nltk.sem import Expression, Valuation
  from nltk.sem.logic import is_indvar
label_desc: Use image node_id 3 for calling the MaceCommand obj's underlying member method code with example usage: obj._convert2val(valuation_str) and returns: Valuation