Implementing NANDlogic in AI programming