A Theoretical Approach to Memristor Devices