The present invention relates to compounds of formula (I) wherein R1, R2, R3, R5, W, X, X1, Y, Y1, Z and Z1 are as defined in the description and in the claims, as well as physiologically acceptable salts thereof. These compounds inhibit PDE10A and can be used as medicaments.本發明係關於式(I)化合物:其中R1、R2、R3、R5、W、X、X1、Y、Y1、Z及Z1係如說明書及申請專利範圍中所定義,以及其生理學上可接受之鹽。該等化合物抑制PDE10A且可用作藥物。