I can see where this would be useful, and also where it would be difficult to implement outside of accessing the relevance evaluator source code. Basically something like the old “Windows Script Debugger” for Relevance evaluation, that would either allow us to step through each bit of evaluation and see the result from each clause separately.
The Relevance given in that PDF, when fed to the Fixlet Debugger in “Single Clause Mode”, then indented, expands to 1,557 lines. It begins with an if…then…else construct; it would be nice to have an automated way to see the result of that “if” evaluation easily.
I realize that we can feed it into the Fixlet Debugger and deconstruct manually, and in fact I frequently do so when I need to determine why I’m getting a false-positive on the builtin content; but it’s tedious to do that later in the evaluation where we’re comparing a hundred or so variations on
(((exists keys ("Microsoft-Windows-ImageBasedSetup-IE-Package-Base-Downlevel~31bf3856ad364e35~x86~~ 6.3.9600.16428") whose ((it = 7 OR it = 112) of (value "CurrentState" of it as integer)) of it) of item 0 of it AND (exists key "x86_microsoft-windows-s..-downlevel.binaries_31bf3856ad364e35_none_f01495e32e766ee3 " whose (exists key (if (exists default value of it) then default value of it as string else "6.3") whose ((it >= "6.3.9600" AND it < "6.3.9600.18015") of (default value of it as string as version)) of it) of it) of item 1 of it OR (exists keys ("Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~x86~~11.2.960 0.16428") whose ((it = 7 OR it = 112) of (value "CurrentState" of it as integer)) of it) of item 0 of it AND (exists key "x86_microsoft-windows-i..etexplorer-optional_31bf3856ad364e35_none_0179e7da91c36af6 " whose (exists key (if (exists default value of it) then default value of it as string else "11.2") whose ((it >= "11.2.9600" AND it < "11.2.9600.18015") of (default value of it as string as version)) of it) of it) of item 1 of it OR (exists keys ("Microsoft-Windows-InternetExplorer-VistaPlus-Update~31bf3856ad364e35~x86~~11.2.960 0.16428") whose ((it = 7 OR it = 112) of (value "CurrentState" of it as integer)) of it) of item 0 of it
…splitting that out requires both copy/pasting of the clause itself, as well as figuring out where item 0 of it and item 1 of it refer, fixing the parentheses for our new single clauses, etc.
It would be handy to have some kind of Fixlet debugger plugin to do what I’d do manually, which would give something like
//IF condition 1
q: exists key "ApplicabilityEvaluationCache\Package_for_KB3087038~31bf3856ad364e35~x86~~11.2.1.0" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing" of native registry
A: False
T: 0.060 ms
//THEN clause 1
q: (set of (7;112) contains item 0 of it AND set of (0;2;4;32;64) contains item 1 of it) of (value "ApplicabilityState" of it as string as integer, value "CurrentState" of it as string as integer) of key "ApplicabilityEvaluationCache\Package_for_KB3087038~31bf3856ad364e35~x86~~11.2.1.0" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing" of native registry
E: Singular expression refers to nonexistent object.
//THEN clause 1.1
q: (value "ApplicabilityState" of it as string as integer, value "CurrentState" of it as string as integer) of key "ApplicabilityEvaluationCache\Package_for_KB3087038~31bf3856ad364e35~x86~~11.2.1.0" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing" of native registry
E: Singular expression refers to nonexistent object.
// THEN clause 1.1.1
q: key "ApplicabilityEvaluationCache\Package_for_KB3087038~31bf3856ad364e35~x86~~11.2.1.0" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing" of native registry
E: Singular expression refers to nonexistent object.
// THEN clause 1.1.1.1
q: key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing" of native registry
A: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing
T: 0.053 ms
// ELSE clause 1
// ( evaluate the entire ELSE here)
// ELSE clause 1.1
// (first component of ELSE clause; not a simple copy/paste because we have to scroll 1500 lines to find where item 0 and item 1 come from, and those have to be repeated for the next hundred or so pieces of the "ELSE" clause..
q: ((exists keys ("Microsoft-Windows-ImageBasedSetup-IE-Package-Base-Downlevel~31bf3856ad364e35~x86~~ 6.3.9600.16428") whose ((it = 7 OR it = 112) of (value "CurrentState" of it as integer)) of it) of item 0 of it) of (key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" of it, key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Winners" of it) of native registry
A: False
T: 0.106 ms
The Relevance evaluator has to be doing this anyway so the logic for parsing must exist; it’s a matter of breaking down and showing each atomic relevance clause independently.
This first cycle of “else” can of course be broken down further for debugging -
// ELSE clause 1.1.1 (removed "exists" to display any matching keys
q: ((keys ("Microsoft-Windows-ImageBasedSetup-IE-Package-Base-Downlevel~31bf3856ad364e35~x86~~ 6.3.9600.16428") whose ((it = 7 OR it = 112) of (value "CurrentState" of it as integer)) of it) of item 0 of it) of (key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" of it, key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Winners" of it) of native registry
T: 0.091 ms
// ELSE clause 1.1.1.1 (removed "whose" filter from keys
q: ((keys ("Microsoft-Windows-ImageBasedSetup-IE-Package-Base-Downlevel~31bf3856ad364e35~x86~~ 6.3.9600.16428")of it) of item 0 of it) of (key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" of it, key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Winners" of it) of native registry
T: 0.111 ms