Dependence Logic: Theory and Applications