yinwang0/pysonar2 — pull request #54 by pondering (2014-12-29 10:57:04+00:00)
Title: add unify to propagate type info backward

Hi,

This commit suggest a new `Node` API called:
````
void unify(Type target, State env)
````

The semantics of this API is that our engine will try its best to match current expression with the `target` type, if it could resolve more symbols, relevant entries will be updated in `env`.

The API is motivated by the following 2 examples:

## Binop
````python
def concat(a):
return "hello, " + a
````
Pysonar2's abstract interpreter will assign "?" type to `a` and proceed. While with `unify`, we could check 2 operands of `Binop`, if one side is string(or int, float..), the other side should be the same type. So we could assign "str" type to a.

## Call
````python
def concat(a):
return "hello, " + a

concat("world")

def f(x):
concat(x)
````
Since we know `concat` is of type "str -> str". When we use it in other places, the arguments to the function should also have "str" type. We can easily achieve this by implementing `unify` for `Call`.

Any discussion is welcome. Thanks.