Contextual inference through flexible integration of environmental features and behavioural outcomes | Synapse