Skip to content

Instantly share code, notes, and snippets.

Last active Mar 21, 2021
What would you like to do?
My first logic program - am I a dinosaur (requires clingo)
% clingo dinosaur.lp
% These are blanket facts, statements that each of these is living
% I think these are called atoms
% This tells use size of arms for each living thing
armsize(vanessa, "small").
armsize(fernando, "large").
armsize(maria, "small").
% A boolean to say we can roar!
% An entity is a dinosaur if they are living, have tiny arms, and can roar.
dinosaur(Entity) :- living(Entity), armsize(Entity, "small"), canroar(Entity).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment