The invention relates to novel heterocyclic compounds of the formula (I) in which all of the variables are as defined in the specification, in free form or in salt form, to their preparation, to their medical use as BACE inhibitors for the treatment of Alzheimer and to medicaments comprising them.