mardi 20 octobre 2015

Self-written facts in Prolog?

How can you write code in Prolog that generates facts in response to the input of the user without you writing them by hand?

For example, i give the input:

Johnny loves Sally. Karen loves Bob.

The program should respond by creating the facts

loves(Johnny, Sally).
loves(Karen, Bob).

How can I do this?





Aucun commentaire:

Enregistrer un commentaire