choice-point

Choice points and Redo's in Prolog

醉酒当歌 提交于 2019-12-04 03:58:26
问题 After asking a question here about when exactly a Redo is called in Prolog with new variables, or when it is attempted with the same, I thought I figured it out. In the following piece of code, however, I thought that an additional Redo were to be called, but that does not seem to be the case. My knowledge base is the following: location(desk,office). location(apple,kitchen). location(flashlight,desk). location('washing machine',cellar). location(nani,'washing machine'). location(broccoli

Choice points and Redo's in Prolog

孤人 提交于 2019-12-01 18:52:08
After asking a question here about when exactly a Redo is called in Prolog with new variables, or when it is attempted with the same, I thought I figured it out. In the following piece of code, however, I thought that an additional Redo were to be called, but that does not seem to be the case. My knowledge base is the following: location(desk,office). location(apple,kitchen). location(flashlight,desk). location('washing machine',cellar). location(nani,'washing machine'). location(broccoli,kitchen). location(crackers,kitchen). location(computer,office). edible(apple). edible(crackers). My query

When is the Redo-port called with new variables in Trace/0 and when not?

折月煮酒 提交于 2019-11-30 09:55:40
问题 During my implementation of the Adventure game in Prolog I was wondering when the redo-port is called with new variables during backtracking and when it is called with the same ones? For example, I have the following knowledge base: location(desk,office). location(apple,kitchen). location(flashlight,desk). location('washing machine',cellar). location(nani,'washing machine'). location(broccoli,kitchen). location(crackers,kitchen). location(computer,office). door(office,hall). door(kitchen