
%%% Wisdom Base

:- dynamic(hierarchy/2).

%%% this predicate defines properties of a concept. The parent nodes of
%%% a concept are defined elsewhere (hierarchy predicate).
%%% syntax: defined(Concept, Property, Value)
defined(tank, capacity, 3).
defined(tank, propellant, gasoline).
defined(tank, dateoforigin, 1916).
defined(tank, maxspeed, 60).
defined(tank, target_audience, military).

defined(smart, capacity, 1.5).
defined(smart, propellant, gasoline).
defined(smart, dateoforigin, 2002). %fixme: correct year
defined(smart, maxspeed, 60).
defined(smart, target_audience, golf_player).

defined(gondola, capacity, 4).
defined(gondola, propellant, gasoline).
defined(gondola, dateoforigin, 1304).
defined(gondola, maxspeed, 10).
defined(gondola, target_audience, recently_married).

defined(chariot, capacity, 3).
defined(chariot, propellant, horsepower).
defined(chariot, dateoforigin, -517).
defined(chariot, maxspeed, 50).
defined(chariot, target_audience, none).

defined(skateboard, capacity, 1).
defined(skateboard, propellant, muscles).
defined(skateboard, dateoforigin, 1969).
defined(skateboard, maxspeed, 25).
defined(skateboard, target_audience, rebellious_youth).

% concepts that will be classified by the go predicates:
defined(longboard, capacity, 1).
defined(longboard, propellant, muscles).
defined(longboard, dateoforigin, 1975).
defined(longboard, maxspeed, 35).
defined(longboard, target_audience, rebellious_youth).

defined(bicycle, capacity, 2).
defined(bicycle, propellant, muscles).
defined(bicycle, dateoforigin, 1869).
defined(bicycle, maxspeed, 50).
defined(bicycle, target_audience, none).

defined(ufo, capacity, 0).
defined(ufo, dateoforigin, 0).
defined(ufo, maxspeed, 0).
defined(ufo, propellant, unknown).
defined(ufo, target_audience, unknown).

defined(zeppelin, capacity, 50).
defined(zeppelin, propellant, gasoline).
defined(zeppelin, dateoforigin, 1840).
defined(zeppelin, maxspeed, 30).
defined(zeppelin, target_audience, historicists).

defined(jetfighter, capacity, 1).
defined(jetfighter, propellant, jetfuel).
defined(jetfighter, dateoforigin, 1950).
defined(jetfighter, maxspeed, 3000).
defined(jetfighter, target_audience, military).

defined(submarine, capacity, 100).
defined(submarine, propellant, uranium).
defined(submarine, dateoforigin, 1910).
defined(submarine, maxspeed, 40).
defined(submarine, target_audience, navy).

%%% this predicate defines properties of a concept. The parent nodes of
%%% a concept are defined elsewhere (hierarchy predicate).
%%% syntax: primitive(Concept, Property, Value)
primitive(rolling, uses_brakes, yes).
primitive(boat, terrain, water).
primitive(boat, as_seen_in, the_love_boat).
primitive(wheels, as_seen_in, dukes_of_hazard).
primitive(wheels, terrain, land).
primitive(motor, harmful, yes).
%primitive(flying, 
%etc...

%%% the hierarchy predicate defines all relations between primitive and defined
%%% concepts. Syntax: hierarchy(Parent, Concept). Parent and Concept can be
%%% either primitive or defined. Note that the concepts which should
%%% be classified by the go predicates are commented out.
hierarchy(thing, vehicle).
hierarchy(vehicle, rolling).
hierarchy(vehicle, motor).
hierarchy(vehicle, boat).
hierarchy(vehicle, flying).

hierarchy(thing, driver).
hierarchy(driver, aliens).
hierarchy(driver, human).
hierarchy(human, captain).
hierarchy(human, rebellious_youth).
hierarchy(human, historicists).
hierarchy(human, recently_married).
hierarchy(human, golf_player).
hierarchy(human, military).
hierarchy(military, navy).

hierarchy(thing, muscles).

%hierarchy(flying, ufo).
%hierarchy(flying, zeppelin).
%hierarchy(flying, jetfighter).
hierarchy(rolling, wheels).
hierarchy(rolling, tank).
%hierarchy(wheels, bicycle).
hierarchy(wheels, chariot).
hierarchy(wheels, skateboard).
hierarchy(wheels, smart).
hierarchy(motor, smart).
hierarchy(boat, gondola).
%hierarchy(boat, submarine).
%etc...

%%% Number restrictions define mininum and maximum interval for numeric properties
numberrestriction(wheels, capacity, 1:1500).
numberrestriction(boat, capacity, 1:15000).
numberrestriction(submarine, capacity, 1:100).
numberrestriction(zeppelin, capacity, 1:100).
%numberrestriction(ufo, capacity, 1:nil).
numberrestriction(tank, capacity, 1:4).
numberrestriction(gondola, capacity, 1:3).
numberrestriction(smart, capacity, 1:2).
numberrestriction(chariot, capacity, 1:1).
numberrestriction(skateboard, capacity, 1:1).
numberrestriction(bicycle, capacity, 1:2).
numberrestriction(jetfighter, capacity, 1:1).

numberrestriction(wheels, maxspeed, 1:500).
numberrestriction(boat, maxspeed, 1:50).
numberrestriction(submarine, maxspeed, 1:50).
numberrestriction(zeppelin, maxspeed, 1:10).
numberrestriction(tank, maxspeed, 1:60).
numberrestriction(gondola, maxspeed, 1:5).
numberrestriction(smart, maxspeed, 1:60).
numberrestriction(chariot, maxspeed, 1:40).
numberrestriction(skateboard, maxspeed, 1:35).
numberrestriction(bicycle, maxspeed, 1:50).
numberrestriction(jetfighter, maxspeed, 1:10000).

numberrestriction(skateboard, dateoforigin, 1969:2099). %help millennium bug!

%%% Necessary properties for childnodes. If a certain primitive specifies
%%% a valuerestriction for a certain properties, then ALL of this
%%% primitive's children need to specify this property.
%%% syntax: valuerestriction(Parent, Property)
%valuerestriction(boat, propellant).
%valuerestriction(vehicle, target_audience).

% valuerestriction(A, B, C) -> 
%		Concept A has attribute B whose value must be an instance of a B.
%valuerestriction(vehicle, target_audience, driver).
%valuerestriction(ufo, target_audience, aliens).
valuerestriction(submarine, target_audience, navy).
valuerestriction(skateboard, target_audience, rebellious_youth).
valuerestriction(skateboard, propellant, muscles).
