<?xml version="1.0" encoding="UTF-8"?>
-<language _name="grafite" version="1.0" _section="Sources" mimetypes="text/x-matita">
+<language id="grafite" _name="grafite" version="2.0" _section="Sources">
+ <metadata>
+ <property name="mimetypes">text/x-matita</property>
+ <property name="globs">*.ma</property>
+ <property name="block-comment-start">(*</property>
+ <property name="block-comment-end">*)</property>
+ </metadata>
- <escape-char>\</escape-char>
+ <styles>
+ <style id="comment" _name="Comment" map-to="def:comment"/>
+ <style id="base-n-integer" _name="Base-N Integer" map-to="def:base-n-integer"/>
+ <style id="string" _name="String" map-to="def:string"/>
+ <style id="keyword" _name="Keyword" map-to="def:keyword"/>
+ <style id="type" _name="Data Type" map-to="def:type"/>
+ <style id="escape" _name="Escaped Character" map-to="def:special-char"/>
+ </styles>
- <block-comment _name = "Commented Code" style = "Comment">
- <start-regex>\(\*\*[^\)]</start-regex>
- <end-regex>[^\(]\*\)</end-regex>
- </block-comment>
+ <definitions>
+ <define-regex id="cap-ident">\b[A-Z][A-Za-z0-9_']*</define-regex>
+ <define-regex id="low-ident">\b[a-z][A-Za-z0-9_']*</define-regex>
+ <define-regex id="char-esc">\\((\\|"|'|n|t|b|r)|[0-9]{3}|x[0-9a-fA-F]{2})</define-regex>
+ <context id="escape-seq" style-ref="escape">
+ <match>\%{char-esc}</match>
+ </context>
+ <!-- here's the main context -->
+ <context id="grafite">
+ <include>
+ <context id="comment" style-ref="comment">
+ <start>\(\*</start>
+ <end>\*\)</end>
+ <include>
+ <context ref="string"/>
+ <context id="comment-in-comment" style-ref="comment">
+ <start>\(\*</start>
+ <end>\*\)</end>
+ <include>
+ <context ref="string"/>
+ <context ref="comment-in-comment"/>
+ <context ref="def:in-comment:*"/>
+ </include>
+ </context>
+ <context ref="def:in-comment:*"/>
+ </include>
+ </context>
+ <context id="string" style-ref="string">
+ <start>"</start>
+ <end>"</end>
+ <include>
+ <context ref="escape-seq"/>
+ </include>
+ </context>
+ <context id="character-constant" style-ref="string">
+ <match>('\%{char-esc}')|('[^\\']')</match>
+ </context>
+ <!-- Flow control & common keywords -->
+ <context id="keywords" style-ref="keyword">
+ <!-- objects -->
+ <keyword>theorem</keyword>
+ <keyword>definition</keyword>
+ <keyword>lemma</keyword>
+ <keyword>fact</keyword>
+ <keyword>remark</keyword>
+ <keyword>variant</keyword>
+ <keyword>axiom</keyword>
- <block-comment _name = "Block Comment" style = "Comment">
- <start-regex>\(\*</start-regex>
- <end-regex>\*\)</end-regex>
- </block-comment>
+ <!-- nobjects -->
+ <keyword>ntheorem</keyword>
+ <keyword>nrecord</keyword>
+ <keyword>ndefinition</keyword>
+ <keyword>ninductive</keyword>
+ <keyword>ncoinductive</keyword>
+ <keyword>nlet</keyword>
+ <keyword>nlemma</keyword>
+ <keyword>naxiom</keyword>
- <keyword-list _name = "Theorem Kinds" style = "Keyword" case-sensitive="TRUE">
- <keyword>theorem</keyword>
- <keyword>definition</keyword>
- <keyword>lemma</keyword>
- <keyword>fact</keyword>
- <keyword>remark</keyword>
- <keyword>variant</keyword>
- <keyword>axiom</keyword>
- </keyword-list>
+ <!-- tactics -->
+ <keyword>absurd</keyword>
+ <keyword>apply</keyword>
+ <keyword>applyP</keyword>
+ <keyword>assumption</keyword>
+ <keyword>autobatch</keyword>
+ <keyword>cases</keyword>
+ <keyword>clear</keyword>
+ <keyword>clearbody</keyword>
+ <keyword>change</keyword>
+ <keyword>compose</keyword>
+ <keyword>constructor</keyword>
+ <keyword>contradiction</keyword>
+ <keyword>cut</keyword>
+ <keyword>decompose</keyword>
+ <keyword>destruct</keyword>
+ <keyword>elim</keyword>
+ <keyword>elimType</keyword>
+ <keyword>exact</keyword>
+ <keyword>exists</keyword>
+ <keyword>fail</keyword>
+ <keyword>fold</keyword>
+ <keyword>fourier</keyword>
+ <keyword>fwd</keyword>
+ <keyword>generalize</keyword>
+ <keyword>id</keyword>
+ <keyword>intro</keyword>
+ <keyword>intros</keyword>
+ <keyword>inversion</keyword>
+ <keyword>lapply</keyword>
+ <keyword>linear</keyword>
+ <keyword>left</keyword>
+ <keyword>letin</keyword>
+ <keyword>normalize</keyword>
+ <keyword>reflexivity</keyword>
+ <keyword>replace</keyword>
+ <keyword>rewrite</keyword>
+ <keyword>ring</keyword>
+ <keyword>right</keyword>
+ <keyword>symmetry</keyword>
+ <keyword>simplify</keyword>
+ <keyword>split</keyword>
+ <keyword>to</keyword>
+ <keyword>transitivity</keyword>
+ <keyword>unfold</keyword>
+ <keyword>whd</keyword>
+ <keyword>assume</keyword>
+ <keyword>suppose</keyword>
+ <keyword>by</keyword>
+ <keyword>is</keyword>
+ <keyword>or</keyword>
+ <keyword>equivalent</keyword>
+ <keyword>equivalently</keyword>
+ <keyword>we</keyword>
+ <keyword>prove</keyword>
+ <keyword>proved</keyword>
+ <keyword>need</keyword>
+ <keyword>proceed</keyword>
+ <keyword>induction</keyword>
+ <keyword>inductive</keyword>
+ <keyword>case</keyword>
+ <keyword>base</keyword>
+ <keyword>let</keyword>
+ <keyword>such</keyword>
+ <keyword>that</keyword>
+ <keyword>by</keyword>
+ <keyword>have</keyword>
+ <keyword>and</keyword>
+ <keyword>the</keyword>
+ <keyword>thesis</keyword>
+ <keyword>becomes</keyword>
+ <keyword>hypothesis</keyword>
+ <keyword>know</keyword>
+ <keyword>case</keyword>
+ <keyword>obtain</keyword>
+ <keyword>conclude</keyword>
+ <keyword>done</keyword>
+ <keyword>rule</keyword>
- <keyword-list _name = "NTheorem Kinds" style = "Keyword" case-sensitive="TRUE">
- <keyword>ntheorem</keyword>
- <keyword>nrecord</keyword>
- <keyword>ndefinition</keyword>
- <keyword>ninductive</keyword>
- <keyword>ncoinductive</keyword>
- <keyword>nlet</keyword>
- <keyword>nlemma</keyword>
- <keyword>naxiom</keyword>
- </keyword-list>
-
- <keyword-list _name = "Commands" style = "Keyword" case-sensitive="TRUE">
- <keyword>alias</keyword>
- <keyword>and</keyword>
- <keyword>as</keyword>
- <keyword>coercion</keyword>
- <keyword>prefer</keyword>
- <keyword>nocomposites</keyword>
- <keyword>coinductive</keyword>
- <keyword>corec</keyword>
- <keyword>default</keyword>
- <keyword>for</keyword>
- <keyword>include</keyword>
- <keyword>include'</keyword>
- <keyword>inductive</keyword>
- <keyword>inverter</keyword>
- <keyword>in</keyword>
- <keyword>interpretation</keyword>
- <keyword>let</keyword>
- <keyword>match</keyword>
- <keyword>names</keyword>
- <keyword>notation</keyword>
- <keyword>on</keyword>
- <keyword>qed</keyword>
- <keyword>rec</keyword>
- <keyword>record</keyword>
- <keyword>return</keyword>
- <keyword>source</keyword>
- <keyword>to</keyword>
- <keyword>using</keyword>
- <keyword>with</keyword>
- </keyword-list>
+ <!-- ntactics -->
+ <keyword>napply</keyword>
+ <keyword>ncases</keyword>
+ <keyword>nletin</keyword>
+ <keyword>nauto</keyword>
+ <keyword>nelim</keyword>
+ <keyword>nwhd</keyword>
+ <keyword>nnormalize</keyword>
+ <keyword>nassumption</keyword>
+ <keyword>ngeneralize</keyword>
+ <keyword>nchange</keyword>
+ <keyword>nrewrite</keyword>
+ <keyword>ncut</keyword>
+ <keyword>nlapply</keyword>
+ <keyword>ndestruct</keyword>
- <keyword-list _name = "NCommands" style = "Keyword" case-sensitive="TRUE">
- <keyword>unification</keyword>
- <keyword>hint</keyword>
- <keyword>ncoercion</keyword>
- <keyword>ninverter</keyword>
- <keyword>nqed</keyword>
- </keyword-list>
+ <!-- commands -->
+ <keyword>alias</keyword>
+ <keyword>and</keyword>
+ <keyword>as</keyword>
+ <keyword>coercion</keyword>
+ <keyword>prefer</keyword>
+ <keyword>nocomposites</keyword>
+ <keyword>coinductive</keyword>
+ <keyword>corec</keyword>
+ <keyword>default</keyword>
+ <keyword>for</keyword>
+ <keyword>include</keyword>
+ <keyword>include'</keyword>
+ <keyword>inductive</keyword>
+ <keyword>inverter</keyword>
+ <keyword>in</keyword>
+ <keyword>interpretation</keyword>
+ <keyword>let</keyword>
+ <keyword>match</keyword>
+ <keyword>names</keyword>
+ <keyword>notation</keyword>
+ <keyword>on</keyword>
+ <keyword>qed</keyword>
+ <keyword>rec</keyword>
+ <keyword>record</keyword>
+ <keyword>return</keyword>
+ <keyword>source</keyword>
+ <keyword>to</keyword>
+ <keyword>using</keyword>
+ <keyword>with</keyword>
+
+
+ <!-- ncommands -->
+ <keyword>unification</keyword>
+ <keyword>hint</keyword>
+ <keyword>ncoercion</keyword>
+ <keyword>ninverter</keyword>
+ <keyword>nqed</keyword>
+
+ <!-- macros -->
+ <keyword>inline</keyword>
+ <keyword>procedural</keyword>
+ <keyword>check</keyword>
+ <keyword>eval</keyword>
+ <keyword>hint</keyword>
+ <keyword>set</keyword>
+ <keyword>auto</keyword>
+ <keyword>nodefaults</keyword>
+ <keyword>coercions</keyword>
+ <keyword>comments</keyword>
+ <keyword>debug</keyword>
+ <keyword>cr</keyword>
+
+ <!-- nmacros -->
+ <keyword>ncheck</keyword>
+
+ <!-- tinycals -->
+ <keyword>try</keyword>
+ <keyword>solve</keyword>
+ <keyword>do</keyword>
+ <keyword>repeat</keyword>
+ <keyword>first</keyword>
+ <keyword>focus</keyword>
+ <keyword>unfocus</keyword>
+ <keyword>progress</keyword>
+ <keyword>skip</keyword>
+ </context>
+ <context id="types" style-ref="type">
+ <!-- sorts -->
+ <keyword>Set</keyword>
+ <keyword>Prop</keyword>
+ <keyword>Type</keyword>
+ <keyword>CProp</keyword>
+
+ <!-- nsorts -->
+ <keyword>Prop</keyword>
+ <keyword>Type[0]</keyword>
+ <keyword>CProp[0]</keyword>
+ <keyword>Type[1]</keyword>
+ <keyword>CProp[1]</keyword>
+ <keyword>Type[2]</keyword>
+ <keyword>CProp[2]</keyword>
+ </context>
+ </include>
+ </context>
+ </definitions>
+<!--
<pattern-item _name = "Command [" style = "Keyword">
<regex>\[</regex>
</pattern-item>
<regex>\$</regex>
</pattern-item>
- <keyword-list _name = "Sorts" style = "Data Type" case-sensitive="TRUE">
- <keyword>Set</keyword>
- <keyword>Prop</keyword>
- <keyword>Type</keyword>
- <keyword>CProp</keyword>
- </keyword-list>
-
- <keyword-list _name = "NSorts" style = "Data Type" case-sensitive="TRUE">
- <keyword>Prop</keyword>
- <keyword>Type[0]</keyword>
- <keyword>CProp[0]</keyword>
- <keyword>Type[1]</keyword>
- <keyword>CProp[1]</keyword>
- <keyword>Type[2]</keyword>
- <keyword>CProp[2]</keyword>
- </keyword-list>
- <keyword-list _name = "Tactics" style = "Others 2" case-sensitive="TRUE">
- <keyword>absurd</keyword>
- <keyword>apply</keyword>
- <keyword>applyP</keyword>
- <keyword>assumption</keyword>
- <keyword>autobatch</keyword>
- <keyword>cases</keyword>
- <keyword>clear</keyword>
- <keyword>clearbody</keyword>
- <keyword>change</keyword>
- <keyword>compose</keyword>
- <keyword>constructor</keyword>
- <keyword>contradiction</keyword>
- <keyword>cut</keyword>
- <keyword>decompose</keyword>
- <keyword>destruct</keyword>
- <keyword>elim</keyword>
- <keyword>elimType</keyword>
- <keyword>exact</keyword>
- <keyword>exists</keyword>
- <keyword>fail</keyword>
- <keyword>fold</keyword>
- <keyword>fourier</keyword>
- <keyword>fwd</keyword>
- <keyword>generalize</keyword>
- <keyword>id</keyword>
- <keyword>intro</keyword>
- <keyword>intros</keyword>
- <keyword>inversion</keyword>
- <keyword>lapply</keyword>
- <keyword>linear</keyword>
- <keyword>left</keyword>
- <keyword>letin</keyword>
- <keyword>normalize</keyword>
- <keyword>reflexivity</keyword>
- <keyword>replace</keyword>
- <keyword>rewrite</keyword>
- <keyword>ring</keyword>
- <keyword>right</keyword>
- <keyword>symmetry</keyword>
- <keyword>simplify</keyword>
- <keyword>split</keyword>
- <keyword>to</keyword>
- <keyword>transitivity</keyword>
- <keyword>unfold</keyword>
- <keyword>whd</keyword>
- <keyword>assume</keyword>
- <keyword>suppose</keyword>
- <keyword>by</keyword>
- <keyword>is</keyword>
- <keyword>or</keyword>
- <keyword>equivalent</keyword>
- <keyword>equivalently</keyword>
- <keyword>we</keyword>
- <keyword>prove</keyword>
- <keyword>proved</keyword>
- <keyword>need</keyword>
- <keyword>proceed</keyword>
- <keyword>induction</keyword>
- <keyword>inductive</keyword>
- <keyword>case</keyword>
- <keyword>base</keyword>
- <keyword>let</keyword>
- <keyword>such</keyword>
- <keyword>that</keyword>
- <keyword>by</keyword>
- <keyword>have</keyword>
- <keyword>and</keyword>
- <keyword>the</keyword>
- <keyword>thesis</keyword>
- <keyword>becomes</keyword>
- <keyword>hypothesis</keyword>
- <keyword>know</keyword>
- <keyword>case</keyword>
- <keyword>obtain</keyword>
- <keyword>conclude</keyword>
- <keyword>done</keyword>
- <keyword>rule</keyword>
-</keyword-list>
-
-<keyword-list _name = "NTactics" style = "Others 2" case-sensitive="TRUE">
- <keyword>napply</keyword>
- <keyword>ncases</keyword>
- <keyword>nletin</keyword>
- <keyword>nauto</keyword>
- <keyword>nelim</keyword>
- <keyword>nwhd</keyword>
- <keyword>nnormalize</keyword>
- <keyword>nassumption</keyword>
- <keyword>ngeneralize</keyword>
- <keyword>nchange</keyword>
- <keyword>nrewrite</keyword>
- <keyword>ncut</keyword>
- <keyword>nlapply</keyword>
- <keyword>ndestruct</keyword>
-</keyword-list>
-
- <keyword-list _name = "Tacticals" style = "Keyword" case-sensitive="TRUE">
- <keyword>try</keyword>
- <keyword>solve</keyword>
- <keyword>do</keyword>
- <keyword>repeat</keyword>
- <keyword>first</keyword>
- <keyword>focus</keyword>
- <keyword>unfocus</keyword>
- <keyword>progress</keyword>
- <keyword>skip</keyword>
- </keyword-list>
-
-
- <keyword-list _name = "Matita Macro" style = "Others 3" case-sensitive="TRUE">
- <keyword>inline</keyword>
- <keyword>procedural</keyword>
- <keyword>check</keyword>
- <keyword>eval</keyword>
- <keyword>hint</keyword>
- <keyword>set</keyword>
- <keyword>auto</keyword>
- <keyword>nodefaults</keyword>
- <keyword>coercions</keyword>
- <keyword>comments</keyword>
- <keyword>debug</keyword>
- <keyword>cr</keyword>
- </keyword-list>
-
- <keyword-list _name = "NMacro" style = "Others 3" case-sensitive="TRUE">
- <keyword>ncheck</keyword>
- </keyword-list>
-
<keyword-list _name = "Whelp Macro" style = "Others 3"
case-sensitive="TRUE"
beginning-regex="whelp *"
<keyword>iforall</keyword>
<keyword>iexists</keyword>
</keyword-list>
-
- <string _name = "String" style = "String" >
- <start-regex>"</start-regex>
- <end-regex>"</end-regex>
- </string>
-
+ -->
</language>