<style>
pre code.bash {
  background: lightyellow;
}
</style>  

Baby Curt

Konsultiere babyCurt.pl und starte den Curt-Dialog mit curt.. Folgende reservierte Befehle stehen während dem Dialog zur Verfügung:

  • readings: prints current readings
  • select N: select a reading (N should be a number)
  • new: starts a new discourse
  • history: shows history of discourse
  • models: prints current models
  • summary: eliminate equivalent readings
  • knowledge: calculate and show background knowledge
  • infix: display formulas in infix notation
  • prefix: display formulas in prefix notation
  • bye: no more talking
  • help: zeigt die Liste der reservierten Befehle

Teste ein paar Dialoge.

Studiere die Implementierung in babyCurt.pl und curtPredicates.pl

Zentrale Klausel:

curtUpdate(Input,[accept],run):-
   kellerStorage(Input,Readings), !,
   updateHistory(Input),
   combine(Readings,NewReadings),
   updateReadings(NewReadings).

Rugrat Curt

rugratCurt.pl

> mia does smoke.

Curt: OK.

> mia does not smoke.

Message (consistency checking): proof found.
Curt: No! I do not believe that!

Zentrale Klauseln:

curtUpdate(Input,Moves,run):-
   kellerStorage(Input,Readings), !,
   updateHistory(Input),
   consistentReadings(Readings,[]-ConsReadings),
   (
      ConsReadings=[],
      Moves=[contradiction]
   ;  
      \+ ConsReadings=[],
      Moves=[accept],
      combine(ConsReadings,CombinedReadings), 
      updateReadings(CombinedReadings)
   ).


/*========================================================================
   Select Consistent Readings
========================================================================*/

consistentReadings([],C-C).

consistentReadings([New|Readings],C1-C2):-
   readings(Old),
   (
      consistent(Old,New), !,
      consistentReadings(Readings,[New|C1]-C2) 
   ;
      consistentReadings(Readings,C1-C2) 
   ).


/*========================================================================
   Consistency Checking calling Theorem Prover 
========================================================================*/

consistent([Old|_],New):-
   rprove(not(and(Old,New))), !,
   nl, write('Message (consistency checking): proof found.'),
   fail.

consistent([],New):-
   rprove(not(New)), !,
   nl, write('Message (consistency checking): proof found.'),
   fail.

consistent(_,_).

Probleme mit rugratCurt:

> every woman smokes.

Curt: OK.

> mia is a woman.

Curt: OK.

> mia does not smoke.

Curt: OK.

Clever Curt

zentrale Klauseln:

curtUpdate(Input,Moves,run):-
   kellerStorage(Input,Readings), !,
   updateHistory(Input),
   consistentReadings(Readings,[]-ConsReadings,[]-Models),
   (
      ConsReadings=[],
      Moves=[contradiction]
   ;  
      \+ ConsReadings=[],
      Moves=[accept],
      combine(ConsReadings,CombinedReadings), 
      updateReadings(CombinedReadings),
      updateModels(Models)
   ).

/*========================================================================
   Select Consistent Readings
========================================================================*/

consistentReadings([],C-C,M-M).

consistentReadings([New|Readings],C1-C2,M1-M2):-
   readings(Old),
   (
      consistent(Old,New,Model), !,
      consistentReadings(Readings,[New|C1]-C2,[Model|M1]-M2) 
   ;
      consistentReadings(Readings,C1-C2,M1-M2) 
   ).


/*========================================================================
   Consistency Checking calling Theorem Prover and Model Builder
========================================================================*/

consistent([Old|_],New,Model):-
   DomainSize=15,
   callTPandMB(not(and(Old,New)),and(Old,New),DomainSize,Proof,Model,Engine),
   format('~nMessage (consistency checking): ~p found a result.',[Engine]),
   \+ Proof=proof, Model=model([_|_],_).

consistent([],New,Model):-
   DomainSize=15,
   callTPandMB(not(New),New,DomainSize,Proof,Model,Engine),
   format('~nMessage (consistency checking): ~p found a result.',[Engine]),
   \+ Proof=proof, Model=model([_|_],_).

Sensitive Curt

curtUpdate(Input,Moves,run):-
   kellerStorage(Input,Readings), !,
   updateHistory(Input),
   consistentReadings(Readings,[]-ConsReadings,[]-Models),
   (
      ConsReadings=[],
      Moves=[contradiction]
   ;
      \+ ConsReadings=[],
      informativeReadings(ConsReadings,[]-InfReadings),   
      (
         InfReadings=[],
         Moves=[obvious]
      ;  
         \+ InfReadings=[],
         Moves=[accept]
      ),
      combine(ConsReadings,CombinedReadings), 
      updateReadings(CombinedReadings),
      updateModels(Models)
   ).


/*========================================================================
   Select Informative Readings
========================================================================*/

informativeReadings([],I-I).

informativeReadings([New|L],I1-I2):-
   readings(Old),
   (
      informative(Old,New), !,
      informativeReadings(L,[New|I1]-I2) 
   ;
      informativeReadings(L,I1-I2) 
   ).


/*========================================================================
   Informativity Checking calling Theorem Prover
========================================================================*/

informative([Old|_],New):-
   DomainSize=15,
   callTPandMB(not(and(Old,not(New))),and(Old,not(New)),DomainSize,Proof,Model,Engine),
   format('~nMessage (informativity checking): ~p found a result.',[Engine]),
   \+ Proof=proof, Model=model([_|_],_).

informative([],New):-
   DomainSize=15,
   callTPandMB(New,not(New),DomainSize,Proof,Model,Engine),
   format('~nMessage (informativity checking): ~p found a result.',[Engine]),
   \+ Proof=proof, Model=model([_|_],_).

Betrachte den folgenden Textverlauf. Folgt der letzte Satz logisch aus den ersten beiden? Ist er also uninformativ? Was sagt Curt und warum?

Sensitive Curt ist nicht in der Lage äquivalente Lesarten zu erkennen und zu elminieren:

Scrupuolous Curt (auch Laconic Curt)

Knowledgeable Curt

Schaue dir folgende Dateien an:

lexicalKnowledge.pl
worldKnowledge.pl
situationalKnowledge.pl
backgroundKnowledge.pl
knowledgeableCurt.pl

Helpful Curt (auch Super Curt)