| 個人檔案Tech Blog部落格清單 | 說明 |
|
11 April Hiatus has endedI've finally gotten back on track and work on reteSharp has started again. I'll keep this blog updated as before with "significant" updates. 28 January HiatusWell in case you havent figured it out ... the development of reteSharp has stalled due to my day job.
I expect to restart development in the late spring ... early summer ... ( I hope). 2 December RHS variables and the Conflict setAnyone are to comment?
(1) RHS variables I guess we can blame that on my RDBMS background but in SQL terms I can access any field related to any of the tables I've specified in the FROM or JOIN clause. I think the same thing should be available to reteSharp developers. It seems silly to build 'empty' BetaNodes just to achieve some variable binding for the RHS part of the rule. It's also inefficient (I think). I think this means we will build the "dtokens" in a slightly different fashion than the standard Rete algorithm. I dont think this is a big deal. (2) Conflict set values Let me try this by observation : Given this "workspace" : (deftemplate Car (slot Color) (slot Make)) (deffacts Init (defrule rule1 Here are the results : Car color is color 'Blue' Make 'ReteI' So it seems like the result set is a CARTESIAN PRODUCT of all of the bound variables. 11 November ASSERTing into the networkASSERTing a fact into the reteSharp network has begun. AlphaNodes with 'single constraints' (i.e. Constants, Variables and Regular Expressions) have been coded. The intra-condition AlphaNodes are up next. This should be too difficult. Last up is the AndOr constraints (i.e. (Color blue|green)). This actually poses something of a challenge.
If the AndOr constraint contains only constants, it can (and will) be evaluated as during the AlphaPhase. If the AndOr constraint contains variables (i.e. (Color blue|?color)), then the constraint will be evaluated during the BetaPhase. If the constraint is satisfied, then the fact gets added to both the AlphaNode fact list and the BetaNode fact list. 2 November BetaNode testing completeIt seems as though reteSharp is decomposing the AlphaNodes and BetaNodes of a rule properly.
<wild cheering from crowd inserted here>
In the Halloween blog entry, an algorithm was presented to determine if a fact satisfied a rule. The algorithm is different than the Forgy's proposal but I think this works also.
That algorithm will be repeated so some clarifications can be made :
When a fact is ASSERTed into the network, the evaluation process will be executed against all rules that contain at least one patternCE for the template used to construct the fact. For each rule :
Clarifications :
Once this code is written, we need TEST CASES .... LOTS of them. Any suggestions, code, data, ideas etc. are appreciated. |
|||
|
|