1 (set-dynamic-constraint-checking TRUE)
  2 (defmodule FISH (export deftemplate menu) )
  3 (deftemplate FISH::fish
  4    (slot species )
  5    (multislot habitat )
  6    (slot seasonal_availability ) ;date of fish runs
  7    (slot open_season ) ;the date legal open season begins
  8    (slot close_season ) ;the date the legal season closes
  9    (slot size_min ) ;minimum legal size allowed to be taken
 10    (slot limit ) ;legal maximum allowed number of fish allowed
 11    (slot fishing_type ) ;bottom or gamefishing 
 12    (slot fishing_location ) ;inshore or offshore 
 13    (multislot best_trip ) ; best to fish day or night
 14    (slot desireability) ; how much people like to fish
 15 )
 16 
 17 (deftemplate FISH::menu
 18  (slot species)
 19  (multislot habitat )
 20  (slot seasonal_availability ) ;date of fish runs
 21  (slot size_min ) ;minimum legal size allowed to be taken
 22  (slot limit ) ;legal maximum allowed number of fish allowed
 23  (slot fishing_type ) ;bottom or gamefishing 
 24  (slot fishing_location ) ;inshore or offshore 
 25  (multislot best_trip ) ; best to fish day or night
 26  (slot desireability) ; how much people like to fish
 27  (slot bonus (type SYMBOL) (allowed-symbols ON OFF) ) ; how much people like to fish
 28 )
 29 (deftemplate FISH::season
 30    (slot description ) (slot start_date) (slot end_date)
 31 )
 32 (deftemplate FISH::date
 33     (slot categ (type SYMBOL) (allowed-symbols today start_date end_date) )
 34     (slot day (type INTEGER) (range 1 31))
 35     (slot month (type INTEGER) (range 1 12))
 36     (slot dateint (type INTEGER)(range 20101 21231 )) ; (dateint  - 20000 ) is the date
 37 )
 38 
 39 (deffunction FISH::openseason (?start ?end ?today )
 40    (if (> ?start ?end )
 41     then
 42      (or
 43          (and (>= ?today ?start ) (<= ?today  21231))
 44          (and (>= ?today 20101 ) (<= ?today ?end))
 45       )
 46      else (and (>= ?today ?start) (<= ?today ?end))
 47    )
 48 )
 49 
 50 (deffacts FISH::fishing_seasons
 51    ( season (description spring_bass_run) (start_date  20401) (end_date 20515) )
 52    ( season (description fall_bass_run) (start_date 21001) (end_date  21201) )
 53    ( season (description winter) (start_date  21215) (end_date 20315) )
 54    ( season (description winter_tautog) (start_date  21015) (end_date 20315) )
 55    ( season (description spring_tautog ) (start_date 20401) (end_date 20515) )
 56    ( season (description warm_months ) (start_date 20415) (end_date 21101) )
 57 )
 58 
 59 
 60 (deffacts FISH::fishes
 61    (fish (species tautog) (habitat bottom wrecks) (seasonal_availability winter_tautog )
 62          (open_season 21022) (close_season 21231 ) (size_min 24 )
 63          (limit 4 ) (fishing_type bottom ) (fishing_location offshore )
 64          (best_trip day ) (desireability 5)
 65    )
 66    (fish (species tautog) (habitat bottom wrecks) (seasonal_availability winter_tautog )
 67          (open_season 21022) (close_season 21231 ) (size_min 24 )
 68          (limit 4 ) (fishing_type bottom ) (fishing_location offshore_federal_waters )
 69          (best_trip day ) (desireability 5)
 70    )
 71    (fish (species tautog) (habitat bottom wrecks) (seasonal_availability winter_tautog )
 72          (open_season 21022) (close_season 21231 ) (size_min 24 )
 73          (limit 4 ) (fishing_type bottom ) (fishing_location inshore )
 74          (best_trip day ) (desireability 2)
 75    )
 76    (fish (species striped_bass) (habitat inshore current rocks ) (seasonal_availability spring_bass_run )
 77          (open_season 20101 ) (close_season 21231 ) (size_min 31  )
 78          (limit 1 ) (fishing_type game) (fishing_location inshore )
 79          (best_trip day night ) (desireability 4)
 80    )
 81    (fish (species striped_bass) (habitat inshore current rocks ) (seasonal_availability fall_bass_run )
 82          (open_season 20101) (close_season 21231 ) (size_min 31 )
 83          (limit 1 ) (fishing_type game ) (fishing_location inshore )
 84          (best_trip day night ) (desireability 4)
 85    )
 86    (fish (species scup) (habitat bottom) (seasonal_availability warm_months )
 87          (open_season 20501 ) (close_season 20831 ) (size_min 10 )
 88          (limit 30 ) (fishing_type bottom ) (fishing_location inshore )
 89          (best_trip day ) (desireability 3 )
 90    )
 91    (fish (species scup) (habitat bottom) (seasonal_availability warm_months )
 92          (open_season 20501 ) (close_season 20831 ) (size_min 10 )
 93          (limit 30 ) (fishing_type bottom ) (fishing_location offshore )
 94          (best_trip day ) (desireability 4 )
 95    )
 96    (fish (species scup) (habitat bottom) (seasonal_availability warm_months )
 97          (open_season 20501 ) (close_season 20831 ) (size_min 10 )
 98          (limit 30 ) (fishing_type bottom ) (fishing_location offshore_federal_waters )
 99          (best_trip day ) (desireability 4 )
100    )
101    (fish (species scup) (habitat bottom) (seasonal_availability warm_months )
102          (open_season 20901 ) (close_season 21031 ) (size_min 10 )
103          (limit 45 ) (fishing_type bottom ) (fishing_location offshore )
104          (best_trip day night) (desireability 4 )
105    )
106    (fish (species scup) (habitat bottom) (seasonal_availability warm_months )
107          (open_season 20901 ) (close_season 21031 ) (size_min 10 )
108          (limit 45 ) (fishing_type bottom ) (fishing_location offshore_federal_waters )
109          (best_trip day night) (desireability 4 )
110    )
111    (fish (species scup) (habitat bottom) (seasonal_availability warm_months )
112          (open_season 20901 ) (close_season 21031 ) (size_min 10 )
113          (limit 45 ) (fishing_type bottom ) (fishing_location inshore )
114          (best_trip day night) (desireability 3 )
115    )
116    (fish (species scup) (habitat bottom) (seasonal_availability warm_months )
117          (open_season 21101 ) (close_season 21231 ) (size_min 10 )
118          (limit 30 ) (fishing_type bottom ) (fishing_location inshore )
119          (best_trip day ) (desireability 3 )
120    )
121    (fish (species scup) (habitat bottom) (seasonal_availability warm_months )
122          (open_season 21101 ) (close_season 21231 ) (size_min 10 )
123          (limit 30 ) (fishing_type bottom ) (fishing_location offshore )
124          (best_trip day ) (desireability 4 )
125    )
126    (fish (species scup) (habitat bottom) (seasonal_availability warm_months )
127          (open_season 21101 ) (close_season 21231 ) (size_min 10 )
128          (limit 30 ) (fishing_type bottom ) (fishing_location offshore_federal_waters )
129          (best_trip day ) (desireability 4 )
130    )
131    (fish (species fluke ) (habitat bottom ) (seasonal_availability warm_months)
132          (open_season 20517) (close_season 20921 ) (size_min 18 )
133          (limit 5 ) (fishing_type bottom ) (fishing_location inshore )
134          (best_trip day ) (desireability 3)
135    )
136    (fish (species bluefish) (habitat open_water current ) (seasonal_availability all_year)
137          (open_season 20101 ) (close_season 21231 ) (size_min 0 )
138          (limit 500 ) (fishing_type game ) (fishing_location inshore )
139          (best_trip day ) (desireability 2 )
140    )
141    (fish (species bluefish) (habitat open_water current ) (seasonal_availability all_year)
142          (open_season 20101 ) (close_season 21231 ) (size_min 12 )
143          (limit 15 ) (fishing_type game ) (fishing_location offshore )
144          (best_trip day ) (desireability 3 )
145    )
146    (fish (species bluefish) (habitat open_water current ) (seasonal_availability all_year)
147          (open_season 20101 ) (close_season 21231 ) (size_min 12 )
148          (limit 15 ) (fishing_type game ) (fishing_location offshore_federal_waters )
149          (best_trip day ) (desireability 3 )
150    )
151    (fish (species cod ) (habitat open_water) (seasonal_availability winter )
152          (open_season 20101 ) (close_season 21231 ) (size_min 22 )
153          (limit 10 ) (fishing_type bottom ) (fishing_location offshore )
154          (best_trip day ) (desireability 3)
155    )
156    (fish (species cod ) (habitat open_water) (seasonal_availability winter )
157          (open_season 20101 ) (close_season 21231 ) (size_min 22 )
158          (limit 10 ) (fishing_type bottom ) (fishing_location offshore_federal_waters )
159          (best_trip day ) (desireability 3)
160    )
161    (fish (species black_sea_bass ) (habitat bottom ) (seasonal_availability warm_months )
162          (open_season 20715) (close_season 21031 ) (size_min 14 )
163          (limit 8 ) (fishing_type bottom ) (fishing_location inshore )
164          (best_trip day ) (desireability 3 )
165    )
166    (fish (species black_sea_bass ) (habitat bottom ) (seasonal_availability warm_months )
167          (open_season 21101) (close_season 21231 ) (size_min 14 )
168          (limit 10 ) (fishing_type bottom ) (fishing_location inshore )
169          (best_trip day ) (desireability 3 )
170    )
171    (fish (species black_sea_bass ) (habitat bottom ) (seasonal_availability warm_months )
172          (open_season 20715) (close_season 21031 ) (size_min 14 )
173          (limit 8 ) (fishing_type bottom ) (fishing_location offshore )
174          (best_trip day ) (desireability 3 )
175    )
176    (fish (species black_sea_bass ) (habitat bottom ) (seasonal_availability warm_months )
177          (open_season 21101) (close_season 21231 ) (size_min 14 )
178          (limit 10 ) (fishing_type bottom ) (fishing_location offshore )
179          (best_trip day ) (desireability 3 )
180    )
181    (fish (species black_sea_bass_federal ) (habitat bottom ) (seasonal_availability warm_months )
182          (open_season 20515) (close_season 20921 ) (size_min 14 )
183          (limit 10 ) (fishing_type bottom ) (fishing_location offshore_federal_waters )
184          (best_trip day ) (desireability 3 )
185    )
186    (fish (species black_sea_bass_federal ) (habitat bottom ) (seasonal_availability warm_months )
187          (open_season 21022) (close_season 21231 ) (size_min 14 )
188          (limit 10 ) (fishing_type bottom ) (fishing_location offshore_federal_waters )
189          (best_trip day ) (desireability 3 )
190    )
191    (fish (species ling ) (habitat mud bottom ) (seasonal_availability winter )
192          (open_season 20101) (close_season 21231 ) (size_min  0)
193          (limit 500 ) (fishing_type bottom ) (fishing_location offshore )
194          (best_trip day ) (desireability 2)
195    )
196    (fish (species ling ) (habitat mud bottom ) (seasonal_availability winter )
197          (open_season 20101) (close_season 21231 ) (size_min  0)
198          (limit 500 ) (fishing_type bottom ) (fishing_location offshore_federal_waters )
199          (best_trip day ) (desireability 2)
200    )
201 )
202