Created
August 27, 2016 20:08
-
-
Save residentkrm/855e4d97ba0e07f1a4215539544b8b2b to your computer and use it in GitHub Desktop.
prolog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOMAINS | |
nflight=integer | |
time=real | |
destination=symbol | |
chast=symbol | |
PREDICATES | |
nondeterm flight(integer,real,symbol,symbol) | |
CLAUSES | |
flight(10000,7.30,"Moskow","every day"). | |
flight(1005,9.30,"Paris","in one day"). | |
flight(10870,14.40,"New-York","every day"). | |
flight(1020,15.10,"London","in one day"). | |
Goal | |
write("Y= "),readreal(Y), | |
flight(Nflight,Time,Destination,"every day"), | |
Time<Y,nl. | |
DOMAINS | |
fam, doljnost = symbol | |
godpr,staj = real | |
PREDICATES | |
NONDETERM emp(fam, doljnost, godpr) | |
CLAUSES | |
emp("Petrov","electric",2000). | |
emp("Ivanov","engineer", 1988). | |
emp("Sidorov","technologist",1995). | |
emp("Akylov","technologist",1996). | |
emp("Vetrov","technologist",2016). | |
GOAL: | |
write("Vvedite tekush god "), readreal(Y), | |
emp(FAM, DOLJNOST, GODPR),(Y-GODPR)>=20. | |
domains | |
nazv = string | |
prib,ss = real | |
PREDICATES | |
nondeterm fin(nazv, prib, ss) | |
CLAUSES | |
fin("Germ",3.2, 102.4). | |
fin("Albo",134.3, 111.30). | |
goal | |
fin(N,P,S),R=P/S*100,R>=10,nl. | |
domains | |
nazv = string | |
volume,rent = real | |
PREDICATES | |
nondeterm fin(nazv, volume, rent) | |
CLAUSES | |
fin("Oly",10000000, 780000). | |
fin("Albo",13000000, 670000). | |
goal | |
fin(N,V,R), | |
V>10000000,nl. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment