0

次のルールがあります。

/*The structure of a subject teaching team takes the form: 
  team(Subject, Leader, Non_management_staff, Deputy). 
 Non_management_staff is a (possibly empty) list of teacher 
structures and excludes the teacher structures for Leader and 
Deputy. 
teacher structures take the form:  
 teacher(Surname, Initial,  
       profile(Years_teaching,Second_subject,Club_supervision)). 
   Assume that each teacher has his or her team's Subject as their  
 main subject.*/  

team(computer_science,teacher(may,j,profile(20,ict,model_railways)), 
 [teacher(clarke,j,profile(32,ict,car_maintenance))], 
 teacher(hamm,p,profile(11,ict,science_club))).

team(maths,teacher(vorderly,c,profile(25,computer_science,chess)), 
 [teacher(o_connell,d,profile(10,music,orchestra)), 
  teacher(brankin,p,profile(20,home_economics,cookery_club))], 
 teacher(lynas,d,profile(10,pe,football))). 

team(english,teacher(brewster,f,profile(30,french,french_society)), 
 [ ], 
 teacher(flaxman,j,profile(35,drama,debating_society))). 

 team(art,teacher(lawless,m,profile(20,english,film_club)), 
 [teacher(walker,k,profile(25,english,debating_society)), 
  teacher(brankin,i,profile(20,home_economics,writing)), 
  teacher(boyson,r,profile(30,english,writing))],
  teacher(carthy,m,profile(20,music,orchestra))).

ict を 2 番目の教科とする合計 2 人以上の教師を含むチームのリーダーのイニシャルと姓を戻すことになっています。

私はプロローグが初めてなので、これがわかりません。また、結果は正しく返ってきましたが、3回返されています。

これに関する任意の助けをいただければ幸いです。

また、これが非常に簡単な場合は申し訳ありません。

4

1 に答える 1

0

これらの教師を見つけるために使用するコードを提供していないため、確かなことは言えませんが、2 番目の主題 (たとえば、computer_science) として ict を使用する 3 人のメンバーを持つチームがある場合、 2 を見つける 3 つの方法 (AB、AC、および BC)。複数の結果を説明します。ただし、コードを修正して修正する方法を説明するには、コードを修正する必要があります。

于 2012-05-16T02:27:07.247 に答える