Tractable Boolean and Arithmetic Circuits