Programming Data Structures In Logic