Code generation based on inference and controlled natural language input