def _getvalue(self, expression):
if not issymbolic(expression):<EOL><INDENT>return expression<EOL><DEDENT>assert isinstance(expression, Variable)<EOL>if isinstance(expression, Array):<EOL><INDENT>result = bytearray()<EOL>for c in expression:<EOL><INDENT>expression_str = translate_to_smtlib(c)<EOL>self._send('<STR_LIT>' % expression_str)<EOL>response = self._recv()<EOL>result.append(int('<STR_LIT>'.format(response.split(expression_str)[<NUM_LIT:1>][<NUM_LIT:3>:-<NUM_LIT:2>]), <NUM_LIT:16>))<EOL><DEDENT>return bytes(result)<EOL><DEDENT>else:<EOL><INDENT>self._send('<STR_LIT>' % expression.name)<EOL>ret = self._recv()<EOL>assert ret.startswith('<STR_LIT>') and ret.endswith('<STR_LIT>'), ret<EOL>if isinstance(expression, Bool):<EOL><INDENT>return {'<STR_LIT:true>': True, '<STR_LIT:false>': False}[ret[<NUM_LIT:2>:-<NUM_LIT:2>].split('<STR_LIT:U+0020>')[<NUM_LIT:1>]]<EOL><DEDENT>elif isinstance(expression, BitVec):<EOL><INDENT>pattern, base = self._get_value_fmt<EOL>m = pattern.match(ret)<EOL>expr, value = m.group('<STR_LIT>'), m.group('<STR_LIT:value>')<EOL>return int(value, base)<EOL><DEDENT><DEDENT>raise NotImplementedError("<STR_LIT>")<EOL>
Ask the solver for one possible assignment for given expression using current set of constraints.
The current set of expressions must be sat.

NOTE: This is an internal method: it uses the current solver state (set of constraints!).