I have a fact and a goal like below:
disconnected.
join :- disconnected, time(T), send(T).
Once this goal executes it should make disconnected false and thus not execute again. I am new to Prolog so I am a bit stuck. I am sure it’s something really simple but can’t figure it out at the moment. Any ideas?
You might use
assertorretractto change the known facts. Or you might use global variables. I am not sure how standard that is.The easiest would be to declare your
joinwith two parameters: input parameter that signifies the current state, and an output parameter signifying the new state.