Formal Modeling and Analysis of Greedy Behaviors