//EvalBinaryExpr returns an associated Expr which is representive of the BinaryExpr within an ast
EvalBinaryExpr returns an associated Expr which is representive of the BinaryExpr within an ast
// EvalBinaryExpr returns an associated Expr which is representive of the BinaryExpr within an ast
func (s *Solver) EvalBinaryExpr(exp *ast.BinaryExpr) Expr {
	left := s.Eval(exp.X)
	right := s.Eval(exp.Y)
	width := GetBVLen(left)
	switch exp.Op {
	case token.ADD:
		return s.BvPlusExpr(width, left, right)
	case token.SUB:
		return s.BvMinusExpr(width, left, right)
	case token.MUL:
		return s.BvMultExpr(width, left, right)
	case token.QUO:
		return s.BvDivExpr(width, left, right)
	case token.REM:
		return s.BvModExpr(width, left, right)
	case token.SHL:
		return s.BvLShiftExpr(width, left, right)
	case token.SHR:
		return s.BvRShiftExpr(width, left, right)
	case token.AND:
		return s.BvAndExpr(left, right)
	case token.OR:
		return s.BvOrExpr(left, right)
	case token.XOR:
		return s.BvXorExpr(left, right)
	case token.LAND:
		return s.AndExpr(left, right)
	case token.LOR:
		return s.OrExpr(left, right)
	case token.LSS:
		return s.BvLtExpr(left, right)
	case token.GTR:
		return s.BvGtExpr(left, right)
	case token.NEQ:
		return s.NotExpr(s.EqExpr(left, right))
	case token.LEQ:
		return s.BvLeExpr(left, right)
	case token.GEQ:
		return s.BvGeExpr(left, right)
	case token.EQL:
		return s.EqExpr(left, right)
	}
	return Expr(nil)
}
func ( s * Solver ) EvalBinaryExpr ( exp * ast . BinaryExpr ) Expr { left := s . Eval ( exp . X ) right := s . Eval ( exp . Y ) width := GetBVLen ( left ) switch exp . Op { case token . ADD : return s . BvPlusExpr ( width , left , right ) case token . SUB : return s . BvMinusExpr ( width , left , right ) case token . MUL : return s . BvMultExpr ( width , left , right ) case token . QUO : return s . BvDivExpr ( width , left , right ) case token . REM : return s . BvModExpr ( width , left , right ) case token . SHL : return s . BvLShiftExpr ( width , left , right ) case token . SHR : return s . BvRShiftExpr ( width , left , right ) case token . AND : return s . BvAndExpr ( left , right ) case token . OR : return s . BvOrExpr ( left , right ) case token . XOR : return s . BvXorExpr ( left , right ) case token . LAND : return s . AndExpr ( left , right ) case token . LOR : return s . OrExpr ( left , right ) case token . LSS : return s . BvLtExpr ( left , right ) case token . GTR : return s . BvGtExpr ( left , right ) case token . NEQ : return s . NotExpr ( s . EqExpr ( left , right ) ) case token . LEQ : return s . BvLeExpr ( left , right ) case token . GEQ : return s . BvGeExpr ( left , right ) case token . EQL : return s . EqExpr ( left , right ) } return Expr ( nil ) }
EvalBinaryExpr returns an associated Expr which is representive of the BinaryExpr within an ast
EvalBinaryExpr returns an associated Expr which is representive of the BinaryExpr within an ast