You are on page 1of 3

AI LAB 7

TITLE: Prediction whether comets, meteors, and asteroids are hazardous to Earth using
Forward Chaining

GROUP MEMBERS:
Namrata Avhad D12A 03
Sonal Belani D12A 05
Nikkita Gurnani D12A 20
Roshni Jaisinghani D12A 24

DOMAIN: AI in Astronomy

FACTS:
1. Earth is a planet
2. Planets are rocky
3. Halley, encke and catalina are comets
4. ceres, Pallas and juno are asteroids
5. lyrids, perseids and geminids are meteor
6. Halley and Ceres enter the earth atmosphere
7. ceres reaches earth surface
8. an asteroid is potentially hazardous if its diameter is more than 140 and its distance from
earth is less than 4.01

CODE:

% Facts about planets


planet(earth, rocky).

% Facts about stars


star(sun, yellow_dwarf).
star(sirius_a, main_sequence).

% Facts about comets


comet(halley).
comet(encke).
comet(catalina).

% Facts about asteroids


asteroid(ceres, 0.95, 4.60, 4.6).
asteroid(pallas, 153, 2.77, 4.6).
asteroid(juno, 0.54, 4.36, 4.4).

% Facts about meteors


meteor(lyrids).
meteor(perseids).
meteor(geminids).
meteor(X) :- (comet(X) ; asteroid(X, _, _,_)), entered_earth_atmosphere(X).

entered_earth_atmosphere(halley).

entered_earth_atmosphere(ceres).
reached_earth_surface(ceres).

orbits_around(earth, sun).
orbits_around(moon, earth).

space_object(Object) :- planet(Object, _) ; star(Object, _) ; comet(Object) ; asteroid(Object,


_, _, _) ; meteor(Object).
potentially_hazardous(Asteroid) :- meteor(Asteroid) ; (asteroid(Asteroid, Diameter,
Distance, _), Diameter > 140, Distance < 4.01).
meteorite(X) :- meteor(X), reached_earth_surface(X).

orbits(X, Y) :- orbits_around(X, Y).


orbits(X, Y) :- orbits_around(X, Z), orbits(Z, Y), space_object(Z).

You might also like