Java tuprolog程序-术语部分未结束,期间异常

Java tuprolog程序-术语部分未结束,期间异常,java,exception,prolog,tuprolog,Java,Exception,Prolog,Tuprolog,我得到了这个例外 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.tupro

我得到了这个例外

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结果:1

我可以从这个异常中了解到,输入prolog文件中存在一些问题,这是我的输入文件,请告诉mw如何解决这个问题

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').
编辑

例外行和位置

Exception line : -1 Position: -1

错误来自以下行:

part ofmod('unique_hospital_number', '(hn),'). MOD的一部分(“唯一的医院编号”(hn)。 它期望在“部分”之后有一段时间。我对tuprolog或语法了解不够,无法确切了解问题所在。“术语部分不是以一个期间结束的。”这意味着“部分”一词不会以一个时期结束


至少您现在知道该去哪里查看。

根据文档,InvalidTheoryException有一行和一个pos字段。捕获异常并将这些值打印到控制台。(并在此处发布结果)异常行:-1位置:-1看起来您在某些位置有编辑错误:“of”似乎插入了“part”之后的一些位置。例如在
prep('subsection of','department of ment')。
。这可能是mod中奇怪的functor
部分的原因。风格上的一点:如果将具有相同functor的子句放在一起,通常会更好、更清晰。例如,将所有
xcomp/2
子句放在一起。有些序言要求这样做。代码是自动生成的,所以有这样的问题。当我在prolog中查询时,我多次得到相同的解决方案。。有没有办法获得一套独特的解决方案?