Logic operations and formulas