<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=SCI_Parser_Programmer%27s_Reference%2FTree_Matching</id>
	<title>SCI Parser Programmer&#039;s Reference/Tree Matching - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=SCI_Parser_Programmer%27s_Reference%2FTree_Matching"/>
	<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=SCI_Parser_Programmer%27s_Reference/Tree_Matching&amp;action=history"/>
	<updated>2026-11-25T09:08:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=SCI_Parser_Programmer%27s_Reference/Tree_Matching&amp;diff=71177&amp;oldid=prev</id>
		<title>Andrew Branscom: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=SCI_Parser_Programmer%27s_Reference/Tree_Matching&amp;diff=71177&amp;oldid=prev"/>
		<updated>2025-02-16T21:00:47Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:00, 16 February 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=SCI_Parser_Programmer%27s_Reference/Tree_Matching&amp;diff=71176&amp;oldid=prev</id>
		<title>Andrew Branscom: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=SCI_Parser_Programmer%27s_Reference/Tree_Matching&amp;diff=71176&amp;oldid=prev"/>
		<updated>2024-06-03T05:14:21Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:14, 3 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=SCI_Parser_Programmer%27s_Reference/Tree_Matching&amp;diff=71175&amp;oldid=prev</id>
		<title>Andrew Branscom at 12:24, 24 June 2022</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=SCI_Parser_Programmer%27s_Reference/Tree_Matching&amp;diff=71175&amp;oldid=prev"/>
		<updated>2022-06-24T12:24:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:SCI Pages]]&lt;br /&gt;
[[Official SCI Documentation]]&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
Chapter: &lt;br /&gt;
[[SCI Parser Programmer&amp;#039;s Reference/Introduction|1]] | &lt;br /&gt;
[[SCI Parser Programmer&amp;#039;s Reference/User Parse Trees|2]] | &lt;br /&gt;
[[SCI Parser Programmer&amp;#039;s Reference/Said Specs|3]] | &lt;br /&gt;
[[SCI Parser Programmer&amp;#039;s Reference/Said Syntax|4]] | &lt;br /&gt;
[[SCI Parser Programmer&amp;#039;s Reference/Said Spec Trees|5]] | &lt;br /&gt;
[[SCI Parser Programmer&amp;#039;s Reference/Tree Matching|6]] | &lt;br /&gt;
[[SCI Parser Programmer&amp;#039;s Reference/Examples|7]] | &lt;br /&gt;
[[SCI Parser Programmer&amp;#039;s Reference/Index|Index]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot;font-size: 22pt&amp;quot;&amp;gt;Tree Matching&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;Author: [[Pablo Ghenis]]&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;Date: 21 July 1988 9:56:56 am&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;br /&amp;gt; Tree Matching ==&lt;br /&gt;
&lt;br /&gt;
The Tree Matching algorithm is quite simple: for each part of the spec tree, find a corresponding branch in the user parse tree. For example if one is looking for a  modifier match, one may search both among the modifiers at the current tree depth and also among the modifiers of the roots, the modifiers of the root&amp;#039;s roots and so on...&lt;br /&gt;
&lt;br /&gt;
Special handling is required for OR and OPT nodes. An OR-node match will only be declared a failure if all the options fail, and it will succeed as soon as one of the options does, not bother to check the rest. An OPT-node match will succeed if a true match is found but also if no matching slot exists in the user tree. However if there is a matching slot with a different word in it the OPT-node match will fail.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;br /&amp;gt; Example ===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;start the radio&amp;quot; will fail to unify with &amp;amp;nbsp;&amp;lt;span class=&amp;quot;Mono&amp;quot;&amp;gt;&amp;#039;start,(turn&amp;lt;on)[/car]&amp;#039;&amp;lt;/span&amp;gt;&amp;amp;nbsp; as follows: &lt;br /&gt;
&lt;br /&gt;
====&amp;lt;br /&amp;gt; User tree ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;&lt;br /&gt;
(root vp&lt;br /&gt;
   (root verb . &amp;#039;start&amp;#039;)&lt;br /&gt;
   (dobj np&lt;br /&gt;
      (ignore art . &amp;#039;the&amp;#039;)&lt;br /&gt;
      (root noun . &amp;#039;radio&amp;#039;)&lt;br /&gt;
   )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;br /&amp;gt; Procedure ===&lt;br /&gt;
&lt;br /&gt;
====&amp;lt;br /&amp;gt; match spec root ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;match spec OR-node try first OR-option (root verb .&amp;#039;start&amp;#039;) -&amp;gt; OK&amp;lt;/blockquote&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
====&amp;lt;br /&amp;gt; match spec optional dobj ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
{| class=&amp;quot;Mono&amp;quot;&lt;br /&gt;
|look for a dobj in user tree ||-&amp;gt; found&lt;br /&gt;
|-&lt;br /&gt;
|if found, compare            ||-&amp;gt; FAILED&lt;br /&gt;
|}&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the tree comparison fails in this example.&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;br /&amp;gt; References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;br /&amp;gt; Also See ==&lt;br /&gt;
&lt;br /&gt;
* &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
[[SCI Parser Programmer&amp;#039;s Reference | Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;float: left&amp;quot;&amp;gt;[[SCI Parser Programmer&amp;#039;s Reference/Said Spec Trees|&amp;amp;lt; Previous: Said Spec Trees]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;float: right&amp;quot;&amp;gt;[[SCI Parser Programmer&amp;#039;s Reference/Examples|Next: Examples &amp;amp;gt;]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical Info]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:References]]&lt;br /&gt;
[[Category:SCI References]]&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:SCI Documentation]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:SCI Development]]&lt;br /&gt;
[[Category:Guides &amp;amp; Other Help]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:SCI Tutorials]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:SCI How To]]&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
[[Category:SCI Scripting]]&lt;br /&gt;
[[Category:The SCI Parser]]&lt;/div&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
</feed>