1

I'm getting this exception

Exception in thread "main" alice.tuprolog.InvalidTheoryException: The term part is not ended with a period.
    at alice.tuprolog.TheoryManager.consult(Unknown Source)
    at alice.tuprolog.Prolog.addTheory(Unknown Source)
    at alice.tuprolog.Prolog.setTheory(Unknown Source)
    at javaapplication9.Main.main(Main.java:32)

Java Result: 1

i can understand from this exception that, some problem in input prolog file and this is my input file, please tell mw how to solve this problem

noun('doctor_investigation_system_(DIS)').
noun('hospital_information_system_(HIS)').
noun('patients,_doctors,_nurses,_diseases,').
verb('have').
noun('unique_hospital_number').
noun('first_name,').
noun('last_name,').
noun('group,_e.g.,_government_officers,_social_security_group,_etc.)').
noun('privilege_types_(rights').
noun('particular_person').
verb('register').
noun('first_visit').
noun('multiple_privilege_types,').
verb('choose').
noun('first_priority').
noun('privilege_type').
verb('define').
noun('secondary_hospital,').
noun('registration_place,').
noun('expired_date').
noun('patient’s_information').
noun('first_name').
noun('last_name').
verb('see').
noun('patient’s_height,_weight,_blood_pressure,').
verb('finish').
verb('investigate').
verb('write').
noun('patient’s_diseases').
noun('unique_code').
noun('generic_name,').
noun('scientific_name').
noun('multiple_generic_names').
verb('allow').
noun('disease’s_information').
verb('consult').
noun('other_doctors').
verb('maintain').
verb('keep').
noun('different_medicines').
noun('different_prices').
verb('make').
noun('specific_time').
noun('identification_number').
cop('part of', 'be').
dep('doctor within_investigation_system_(DIS)', 'part of').
prep('part of', 'hospital_information_system_(HIS)').
nsubj('manipulates', 'DIS').
dobj('manipulates', 'datum about').
prep('datum about', 'patient ats,_doctor withins,_nurses,_diseases,').
prep('datum about', 'medicine').
conj_and('patient ats,_doctor withins,_nurses,_diseases,', 'medicine').
nsubj('have', 'patient at').
dobj('have', 'unique_hospital_number').
part ofmod('unique_hospital_number', '(hn),').
dobj('(hn),', 'first_name of,').
nsubj('reserved by', 'last_name of,').
nsubj('group,_e.g.,_government_officers,_social_security_group,_etc.)', 'last_name of,').
conj_and('last_name of,', 'privilege_types_(rights').
nsubj('reserved by', 'privilege_types_(rights').
dep('have', 'reserved by').
prep('reserved by', 'part oficular_person').
dep('have', 'group,_e.g.,_government_officers,_social_security_group,_etc.)').
conj_or('reserved by', 'group,_e.g.,_government_officers,_social_security_group,_etc.)').
nsubj('register on', 'patient at').
prep('register on', 'date of').
prep('date of', 'first_visit').
prep('date of', 'patient at').
conj_and('first_visit', 'patient at').
nsubj('record by', 'profile').
cop('record by', 'be').
dep('register on', 'record by').
prep('record by', 'officer').
nsubj('have', 'patient at').
dobj('have', 'multiple_privilege_types,').
prep('one of', 'multiple_privilege_types,').
nsubj('choose as', 'one of').
rcmod('multiple_privilege_types,', 'choose as').
prep('choose as', 'first_priority').
nsubj('define', 'privilege_type').
amod('hospital,', 'primary').
dobj('define', 'hospital,').
prep('define', 'secondary_hospital,').
dep('secondary_hospital,', 'registration_place,').
dep('secondary_hospital,', 'expired_date of').
conj_and('registration_place,', 'expired_date of').
nsubj('search', 'nurse').
dobj('search', 'patient at’s_information').
prepc_by('search', 'use').
nsubj('first_name of', 'HN,').
xcomp('use', 'first_name of').
xcomp('use', 'last_name of').
conj_or('first_name of', 'last_name of').
nsubj('see', 'patient at').
dobj('see', 'doctor within,').
dobj('need', 'doctor within,').
nsubj('need', 'nurse').
xsubj('record by', 'nurse').
rcmod('doctor within,', 'need').
xcomp('need', 'record by').
dobj('record by', 'patient at’s_height,_weight,_blood_pressure,').
dobj('record by', 'symptom').
conj_and('patient at’s_height,_weight,_blood_pressure,', 'symptom').
nsubj('finish', 'doctor within').
xcomp('finish', 'investigate').
dobj('investigate', 'patient at,').
dobj('have', 'patient at,').
nsubj('have', 'doctor within').
xsubj('write', 'doctor within').
rcmod('patient at,', 'have').
xcomp('have', 'write').
dobj('write', 'patient at’s_diseases').
nsubj('have', 'disease').
amod('“icd', 'unique_code').
dep('unique_code', '(called').
dobj('have', '“icd').
amod('“icd', 'generic_name of,').
amod('“icd', 'scientific_name of').
conj_and('generic_name of,', 'scientific_name of').
num('disease', 'One').
nsubj('have', 'disease').
dobj('have', 'multiple_generic_name ofs').
num('scientific_name of', 'one of').
dobj('have', 'scientific_name of').
conj_only('multiple_generic_name ofs', 'scientific_name of').
nsubj('allow', 'system').
dobj('allow', 'officer').
infmod('officer', 'print by').
dobj('print by', 'disease’s_information').
prep('print by', 'use').
dep('use', 'code').
nsubj('consult with', 'doctor within').
prep('consult with', 'other_doctor withins about').
prep('other_doctor withins about', 'patient at').
nsubj('case,', 'that').
cop('case,', 'be').
dobj('have', 'case,').
nsubj('have', 'name of').
prep('name of', 'doctor within').
prep('name of', 'name of').
conj_and('doctor within', 'name of').
prep('name of', 'consult withant').
rcmod('case,', 'have').
xcomp('have', 'maintain').
nsubj('be', 'name of').
prep('name of', 'doctor within').
ccomp('otherwise,', 'be').
ccomp('be', 'keep').
nsubj('order', 'doctor within').
nsubj('have', 'medicine').
conj_and('medicine', 'different_medicines').
nsubj('have', 'different_medicines').
ccomp('order', 'have').
dobj('have', 'different_prices').
nsubj('make with', 'doctor within').
dobj('make with', 'appointment').
prep('make with', 'patient at').
cop('more', 'be').
dep('there', 'more').
num('doctor within', 'one of').
nsubj('make with', 'doctor within').
prep('doctor within', 'clinic').
prep('doctor within', 'doctor within').
conj_and('clinic', 'doctor within').
dobj('make with', 'appointment').
num('patient at', 'one of').
prep('make with', 'patient at').
prep('patient at', 'specific_time').
nsubj('have', 'list of').
xsubj('maintain', 'list of').
prep('list of', 'clinic').
xcomp('have', 'maintain').
xcomp('have', 'clinic').
conj_and('maintain', 'clinic').
cop('subdivision of', 'be').
xcomp('have', 'subdivision of').
conj_and('maintain', 'subdivision of').
prep('subdivision of', 'depart ofment').
conj_and('doctor within', 'nurse').
cop('staff', 'be').
dep('doctor within', 'staff').
nsubj('have', 'nurse').
conj_and('nurse', 'doctor within').
nsubj('have', 'doctor within').
dobj('have', 'identification_number').
part ofmod('identification_number', '(id),').
nsubj('last_name of,', 'first_name of,').
xcomp('(id),', 'last_name of,').
xcomp('(id),', 'address').
conj_and('last_name of,', 'address').
nsubj('need', 'we').
xsubj('keep', 'we').
xcomp('need', 'keep').
dobj('keep', 'clinic').
nsubj('work', 'doctor within').
cop('work', 'be').
rcmod('clinic', 'work').

EDIT

Exception line and position

Exception line : -1 Position: -1
manlio
  • 18,345
  • 14
  • 76
  • 126
karthi
  • 2,762
  • 4
  • 30
  • 28
  • According to documentation, InvalidTheoryException has a line and a pos field. Catch the exception and print those values to the console. (and post the result here) – Cephalopod Sep 23 '10 at 13:47
  • Exception line : -1 Position: -1 – karthi Sep 23 '10 at 13:51
  • It looks like you have an editing error in places: " of" seems to have been inserted after "part" in a few places. For example in `prep('subdivision of', 'depart ofment').` . This could be the cause of the strange functor `part ofmod`. – rvirding Sep 23 '10 at 15:00
  • A stylistic point: It is usually better and clearer if you keep clauses with the same functor together. So for example keep all `xcomp/2` clauses together. Some Prologs demand this. – rvirding Sep 23 '10 at 15:06
  • the code is auto generated so having such problems. when i query in prolog i get the same solutions for more than one time.. is there any way to get unique set of solutions? – karthi Sep 23 '10 at 17:10
  • Without seeing the rest of the code and query it is hard to give a good answer. One way is to wrap it with `once/1` but whether that is a good solution or a hack depends. – rvirding Sep 24 '10 at 23:58

1 Answers1

0

The error is from the line:

part ofmod('unique_hospital_number', '(hn),').

It is expecting a period after the "part". I don't know enough about tuprolog or the syntax to know exactly what the problem is. "The term part is not ended with a period." This means the term "part" is not ended with a period.

At least you know where to look now.

Erick Robertson
  • 32,125
  • 13
  • 69
  • 98