Learning answer set programming rules for ethical machines