Ages and masses of asymptotic giant branch stars from the period–luminosity diagram | Synapse