Analysing decisions I: a general framework