0
votes

What's wrong ? I try to build prolog program but complier throw error number c150 . How to fix

domains
      NAME=string.
      NUM=symbol.
      N=integer.
predicates
      abon(NAME,NUM)
      abonname(NAME,NUM)
      abonnum(NAME,NUM)
      punkt(N)
      menu
      repeat
clauses
      abon(alex,"111234").
      abon(ivan,"123456").
      abon(petr,"135679").
      abon(semen,"141258").
      abon(evgen,"157989").
      abon(dima,"234577").
      abon(semen,"245876").
      abon(oleg,"342588").
      abon(roman,"428576").

      abonname(NAME,NUM):-abon(NAME,NUM),!.
                          abonname(_,"No information about number").
      abonnum(NAME,NUM):-abon(NAME,NUM),!.
                         abonnum("No information about name",_).

      menu:-repeat,write("nomer menu-"),nl,
            write("1-all information"),nl,
        write("2-search by name"),nl,
        write("3-search by number"),nl,
            write("0-exit"),nl,
            readint(N),punkt(N),N=0.

      punkt(N):-N=1,abon(NAME,NUM),
                write(NAME,"-",NUM),nl,fail.
      punkt(N):-N=2,write("Name?:"),nl,readln(NAME),
                abonname(NAME,NUM),write("nomer-",NUM),nl,fail.
      punkt(N):-N=3,write("Number?:"),nl,readln(NUM),
            abonnum(NAME,NUM),write("imya-",NAME),nl,fail.
      punkt(0):-write("Exit").

      repeat.
      repeat:-repeat.

goal
      menu.

1

1 Answers

0
votes

The code is in an very old style. Since Visual Prolog 6.0 you will have to use an updated class-based syntax.