code: def encode_inputs(self):
          
          litmap = dict()
          nvars = 0
          for i, v in enumerate(self.inputs, start=1):
              litmap[v] = i
              litmap[~v] = -i
              litmap[i] = v
              litmap[-i] = ~v
              nvars += 1
          return litmap, nvars
docs: Return a compact encoding for input variables.