Here's a paper that gives a good high level overview of data driven backward-chaining as provided in the Eclipse programming language:
http://haleyai.com/pdf/BackwardChaining.pdf. This is the same basic approach as used in Jess which is to automatically generate goals when a pattern isn't matched by a fact, but the proceeding patterns do have matches. If you look at how an example works in Jess, you can infer some of the steps you'll need to implement:
Jess, the Java Expert System Shell
Copyright (C) 2001 E.J. Friedman Hill and the Sandia Corporation
Jess Version 6.1p4 7/8/2003
Jess> (deftemplate point (slot x) (slot y))
TRUE
Jess> (do-backward-chaining point)
TRUE
Jess>
(defrule example
(value ?x)
(point (x ?x) (y 3))
=>)
TRUE
Jess> (reset)
TRUE
Jess> (facts)
f-0 (MAIN::initial-fact)
For a total of 1 facts.
Jess> (assert (value 2))
<Fact-1>
Jess> (facts)
f-0 (MAIN::initial-fact)
f-1 (MAIN::value 3)
f-2 (MAIN::need-point (x 2) (y 3))
For a total of 3 facts.
Jess>
In this case, when the fact (value 2) is asserted, the goal fact (need-point (x 2) (y 3)) is generated because the second pattern in the rule isn't matched. So probably what's happening is that there's an assert statement associated with the join in the join network associated with the point pattern: (assert (need-point (x ?x) (y 3))). In order to construct this, you'd need to look at the point pattern and see that the x and y slots are both used in the pattern and so the values need to be included in the assert statement. If Jess works similarly to CLIPS, then the reference to the variable ?x would be replaced with a function call that retrieves the first field from the value fact matching the first pattern. And since the goal generation is going to be happening during the assertion or retraction of a fact, the assertion of that goal will need to be queued and then asserted once the current fact assertion/retraction is complete. It wouldn't be possible to do something similar in CLIPS without creating your own patches.
I think if you're going to do this, you'll need to step through the debugger with a simple rule:
CLIPS> (deftemplate point (slot x) (slot y))
CLIPS>
(defrule example
(point (x ?x))
(point (x 2) (y ?y&:(> ?y ?x)))
=>
(println ?x " " ?y))
CLIPS>
This will let you see how the patterns are constructed (because you'll need to examine these to see which slots to assert) and you can see how the references to ?x and ?y are replaced with function calls for the > function in the LHS and the println function in the RHS.