Programming Piaget's logical operations for science inquiry and concept attainment