Analyzing and Planning Contracts