Algorithm 1 Working Memory Updating Algorithm Input: Fact(s), Context(s) START Load Facts Check WM Flag if (Falg == False) then set Flag True Load Preference Set Number Load context to WM end else CheckPreference Set Number if (Preference Set Number Matches OR Preference Set Number == '") then Check Rule for Distinet Consequent part if (Consequent is Distinct) then Append the rule in WM end else Overwrite the rule (over the same consequent rule in WM) end end else Clear WM (Except the rules with Preference == '") Load Preference Set Number Load Context in WM end end END