Quantcast
Channel: Recent Gists from vsoch
Viewing all articles
Browse latest Browse all 30

My first logic program - am I a dinosaur (requires clingo)

$
0
0
dinosaur.lp
% clingo dinosaur.lp
% These are blanket facts, statements that each of these is living
% I think these are called atoms
living(vanessa).
living(fernando).
living(maria).
% 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!
canroar(vanessa).
% An entity is a dinosaur if they are living, have tiny arms, and can roar.
dinosaur(Entity) :- living(Entity), armsize(Entity, "small"), canroar(Entity).

Viewing all articles
Browse latest Browse all 30

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>