A type system equivalent to flow analysis