Lambda the Ultimate has an interesting post about the passage of time in computing systems. It's not talking about real-time systems. Rather, it deals with a fundamental limitation of most computing systems in that they deal with data transformations and not physical processes. This means that any data transformation can be problematic in a concurrent model when one process changes something that other processes are not expecting. Consider Prolog:
That adds the fact "frank is a male" to the database. Unfortunately, this is a destructive operation and survives backtracking (note that this state alteration doesn't require concurrency to be problematic). When this occurs, the programmer must be very careful to manually undo all changes upon failure. For large code bases, this is hard. Thus, asserting and retracting to/from the database should be used sparingly. The generally assumed solution is to create lists which maintain state and manipulate those lists since those manipulations are undone on backtracking. Unfortunately, when I read about this, programmers generally agree that this is painful.
That's interesting, though, because "state" is correlated with "time". At any given point in time, the state of a system is the state of the system. It doesn't change because change requires time. The solution, then, seems to be incorporating time into a system to ensure that for any given operation, the time is known. You could assert at will into the database and the assertions would be marked by time. Upon backtracking, the previous "time" of the system is restored and further unification would ignore facts and rules with a future time.
Still, I don't think that quite solves the problem if you assert a fact and your query fails, you probably want to retract that fact. There's a nifty blog post which describes a trivial way to get the correct behavior with standard Prolog. That's nifty and I'm tempted to make this the default behavior in AI::Logic. Since it's being built from the ground up and is not yet released, I'm free to do this. This solves the backtracking problem, but not the concurrency one. If you assert something and something else picks it up, whoops! I wish I could figure out time. I was thinking about "ticks" to artificially track time, but frankly, I doubt I'm smart or experienced enough to really figure this out.