Programming Cognitive Agents in Defeasible Logic