B
    `a[ZJ                 @   s   d Z ddlZddlmZmZmZ ddlmZmZm	Z	m
Z
mZmZmZmZmZ dddgZG dd deZG d	d deZG d
d deZdS )z
    pygments.lexers.theorem
    ~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for theorem-proving languages.

    :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    N)
RegexLexerdefaultwords)	TextCommentOperatorKeywordNameStringNumberPunctuationGenericCoqLexerIsabelleLexer	LeanLexerc               @   s  e Zd ZdZdZdgZdgZdgZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdefdejjfdedfeedddejfee	dddefee
dddejfeedddefeedddejfeedddejfdefddeddd  efdeeef efdde ejfdefdej fd ej!fd!ej"fd"ej#fd#ej$fd$e%j&fd%e%j&fd&efd'e%j'd(fd)efgd*efded+fd,ed-fd.efgd/e%j'fd0e%j'fd'e%j'd-fgdefd1e(fd2ejfd3ej)d-fd4ed-fe*d-gd5Z+d6d7 Z,dS )8r   zZ
    For the `Coq <http://coq.inria.fr/>`_ theorem prover.

    .. versionadded:: 1.5
    ZCoqZcoqz*.vz
text/x-coq)MZSectionZModuleZEndZRequireZImportZExportVariableZ	VariablesZ	ParameterZ
ParametersZAxiomZ
HypothesisZ
HypothesesZNotationZLocalZTacticReservedZScopeZOpenZCloseZBindZDelimitZ
DefinitionZLetZLtacZFixpointZ
CoFixpointZMorphismZRelationZImplicitZ	ArgumentsSetZUnsetZ
ContextualZStrictZPrenexZ	ImplicitsZ	InductiveZCoInductiveZRecordZ	StructureZ	CanonicalZCoercionZTheoremZLemmaZ	CorollaryZPropositionZFactZRemarkZExampleZProofZGoalZSaveZQedZDefinedZHintZResolveZRewriteZViewZSearchZShowZPrintZPrintingZAllZGraphZProjectionsZinsideZoutsideZCheckZGlobalZInstanceClassZExistingZUniverseZPolymorphicZMonomorphicZContext)forallexistsZexists2funfixZcofixZstructmatchendinreturnletifisthenelseforZofZnosimplwithas)TypeProp)CZposesetZmovecaseZelimapplyclearZhnfZintroZintrosZ
generalizerenamepatternZafterZdestructZ	inductionusingZrefineZ	inversionZ	injectionZrewriteZcongrZunlockZcomputeZringZfieldreplaceZfoldZunfoldZchangeZ
cutrewriteZsimplhaveZsuffZwlogZsufficesZwithoutZlossZnat_normassertZcutZtrivialZrevertZ
bool_congrZ	nat_congrZsymmetryZtransitivityautosplitleftrightZautorewritetautoZsetoid_rewriteZ	intuitionZeautoZeapplyZeconstructorZetransitivityconstructorZerewriteZredZcbvlazyZ
vm_computeZnative_computeZsubst)bydoneexactZreflexivityr5   ZromegaZomegaZ
assumptionZsolveZcontradictionZdiscriminateZ
congruence)ZdoZlastfirsttryZidtacrepeat)1z!=#&z&&z\(z\)z\*z\+,-z-\.z->z\.z\.\.:z::z:=z:>;z;;<z<-z<->=>z>]z>\}z\?z\?\?z\[z\[<z\[>z\[\|]_`z\{z\{<z\|z\|]z\}~z=>z/\\z\\/z\{\|z\|\}u   Πu   λz[!$%&*+\./:<=>?@^|~-]z[!?~]z[=<>@^|&+\*/$%-])ZunitZnatboolstringasciilistz\s+zfalse|true|\(\)|\[\]z\(\*commentz\b)prefixsuffixz\b([A-Z][\w\']*)z(%s)|Nz
(%s|%s)?%sz\b(%s)\bz[^\W\d][\w']*z\d[\d_]*z0[xX][\da-fA-F][\da-fA-F_]*z0[oO][0-7][0-7_]*z0[bB][01][01_]*z(-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)z7'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'z'.''"rL   z[~?][a-z][\w\']*:z[^(*)]+z#pushz\*\)z#popz[(*)]z[^"]+z""z\.z[A-Z][\w\']*(?=\s*\.)z[A-Z][\w\']*z[a-z][a-z0-9_\']*)rootrO   rL   Zdottedc             C   s   |  drdS d S )Nz(*T)
startswith)text rY   6lib/python3.7/site-packages/pygments/lexers/theorem.pyanalyse_text   s    
zCoqLexer.analyse_text)-__name__
__module____qualname____doc__namealiases	filenames	mimetypes	keywords1	keywords2	keywords3Z	keywords4Z	keywords5Z	keywords6Zkeyopts	operatorsZprefix_symsZ
infix_symsZ
primitivesr   r	   BuiltinPseudor   r   r   	Namespacer%   r   joinr   r   IntegerHexOctBinZFloatr
   ZCharDoubler   r   r   tokensr[   rY   rY   rY   rZ   r      sn   



c            "   @   s  e Zd ZdZdZdgZdgZdgZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdefdedfdedfeeefeeejfeeddde j!fee	ddde j"fee
ddde feeddde feeddde#j$feeddde#j%feeddde j&feeddde j&feeddde#j'feeddde feeddde feeddde feeddde feeddde feeddde feeddde feeddde j!fd ej(fd!e)fd"e)fd#e)j"fd$e)fd%e*j+fd&e*j,fd'e*j-fd(e.d)fd*e.j/d+fg d,efded-fd.ed/fd0efgd1efd2ed/fd3efd4efgd5e.fd e.j(fd6e.fd7e.fd(e.d/fgd8e.j/fd e.j(fd9e.j/fd7e.j/fd*e.j/d/fgd:Z0d;S )<r   zf
    For the `Isabelle <http://isabelle.in.tum.de/>`_ proof assistant.

    .. versionadded:: 2.0
    ZIsabelleZisabellez*.thyztext/x-isabelle)2andZassumesZattachZavoidsZbinderZcheckingZclass_instanceZclass_relationZcode_moduleZcongsconstantZ
constrainsZ	datatypesZdefinesfilefixesr"   Z	functionsZhintsZ
identifierr   Zimportsr   Zincludesinfixinfixlinfixrr   keywordsr7   Zmodule_nameZmonosZ	morphismsZno_discs_selsZnotesZobtainsopenoutputZ
overloadedZ
parametricZ
permissiveZ	pervasiveZ
rep_compatZshows	structureZ
type_classZtype_constructorZ	uncheckedZunsafewhere)LZ
ML_commandZML_valZ
class_depsZ	code_depsZ	code_thmsZdisplay_draftsZfind_constsZfind_theoremsZfind_unused_assmsZfull_prfhelpZlocale_depsZnitpickZprZprfZprint_abbrevsZprint_antiquotationsZprint_attributesZprint_bindsZ
print_bnfsZprint_bundlesZprint_case_translationsZprint_casesZprint_clasetZprint_classesZprint_codeprocZprint_codesetupZprint_coercionsZprint_commandsZprint_contextZprint_defn_rulesZprint_dependenciesZprint_factsZprint_induct_rulesZprint_inductivesZprint_interpsZprint_localeZprint_localesZprint_methodsZprint_optionsZprint_ordersZprint_quot_mapsZprint_quotconstsZprint_quotientsZprint_quotientsQ3Zprint_quotmapsQ3Zprint_rulesZprint_simpsetZprint_stateZprint_statementZprint_syntaxZprint_theoremsZprint_theoryZprint_trans_rulesZproppwdZ
quickcheckZrefuteZsledgehammerZ
smt_statusZsolve_directZspark_statusZtermZthmZthm_depsZthy_depsr<   Ztry0typZunused_thmsvaluevaluesZwelcomeZprint_ML_antiquotationsZprint_term_bindingsZvalues_prolog)Ztheorybeginr   )headerZchapter)sectionZ
subsectionZsubsubsectionZsectZsubsectZ
subsubsect)ZMLZML_fileabbreviationZadhoc_overloadingZaritiesZ	atom_declZattribute_setupZaxiomatizationZbundleZcase_of_simpsclassclassesZclassrelZ
codatatypeZ
code_abortZ
code_classZ
code_constZcode_datatypeZcode_identifierZcode_includeZcode_instanceZcode_modulenameZ
code_monadZcode_printingZcode_reflectZcode_reservedZ	code_typeZcoinductiveZcoinductive_setZconstscontextZdatatypeZdatatype_newZdatatype_new_compatZdeclarationZdeclareZdefault_sortZdefer_recdef
definitionZdefsZdomainZdomain_isomorphismZ	domaindefZequivarianceZexport_codeextractZextract_typeZfixrecr   Z	fun_casesZ
hide_classZ
hide_constZ	hide_factZ	hide_typeZimport_const_mapZimport_fileZimport_tptpZimport_type_map	inductiveZinductive_setZinstantiationZjudgmentZlemmasZlifting_forgetZlifting_updateZlocal_setupZlocaleZmethod_setupZnitpick_paramsZno_adhoc_overloadingZno_notationZ	no_syntaxZno_translationsZno_type_notationZnominal_datatypeZnonterminalnotationZnotepadZoracleZoverloadingZparse_ast_translationZparse_translationZpartial_functionZ	primcorecZprimrecZprimrec_newZprint_ast_translationZprint_translationZquickcheck_generatorZquickcheck_paramsZrealizabilityZ	realizersZrecdefrecordZrefute_paramsZsetupZsetup_liftingZsimproc_setupZsimps_of_caseZsledgehammer_paramsZ	spark_endZ
spark_openZspark_open_sivZspark_open_vcgZspark_proof_functionsZspark_typesZ
statespaceZsyntaxZsyntax_declarationrX   Ztext_rawZtheoremsZtranslationsZtype_notationZtype_synonymZtyped_print_translationZtypedeclZ
hoarestateZinstall_C_fileZinstall_C_typesZ	wpc_setupZc_defsZc_typesZmemsafeZ
SML_exportZSML_fileZ
SML_importZapproximateZbnf_axiomatizationZ	cartoucheZdatatype_compatZfree_constructorsZfunctorZnominal_functionZnominal_terminationZpermanent_interpretationZbindsZdefiningZsmt2_statusZterm_cartoucheZboogie_fileZtext_cartouche)Zinductive_casesZinductive_simps)!Zax_specificationZbnfZ	code_pred	corollaryZcpodefZcrunchZcrunch_ignoreZenriched_typeZfunctioninstanceZinterpretationlemmaZlift_definitionZnominal_inductiveZnominal_inductive2Znominal_primrecZpcpodefZprimcorecursiveZquotient_definitionZquotient_typeZ	recdef_tcZrep_datatypeZschematic_corollaryZschematic_lemmaZschematic_theoremZspark_vcZspecificationsubclassZ	sublocaleZterminationtheoremZtypedefZwrap_free_constructors)r8   r9   qed)ZsorryZoops)r/   ZhenceZ	interpret)nextproof)finallyfromr    Z
ultimatelyr#   )ZML_prfZalsoZinclude	includingr   ZmoreoverZnoteZtxtZtxt_rawZ	unfoldingr-   write)assumer(   defr   Zpresume)ZguessobtainshowZthus)r)   Z	apply_endZapply_traceZbackZdeferZprefer)z::rB   ()[rG   rH   rE   r@   rR   +rA   !?){}.z..z\s+z\(\*rO   z\{\*rX   z\b)rP   rQ   z\\<\w*>z[^\W\d][.\w']*z\?[^\W\d][.\w']*z'[^\W\d][.\w']*z\d[\d_]*z0[xX][\da-fA-F][\da-fA-F_]*z0[oO][0-7][0-7_]*z0[bB][01][01_]*rU   rL   rI   factz[^(*)]+z#pushz\*\)z#popz[(*)]z[^*}]+z\*\}z\*z\}z[^"\\]+z\\"z\\z[^`\\]+z\\`)rV   rO   rX   rL   r   N)1r\   r]   r^   r_   r`   ra   rb   rc   Zkeyword_minorZkeyword_diagZkeyword_thyZkeyword_sectionZkeyword_subsectionZkeyword_theory_declZkeyword_theory_scriptZkeyword_theory_goalZkeyword_qedZkeyword_abandon_proofZkeyword_proof_goalZkeyword_proof_blockZkeyword_proof_chainZkeyword_proof_declZkeyword_proof_asmZkeyword_proof_asm_goalZkeyword_proof_scriptrg   Zproof_operatorsr   r   r   r   ZWordr   ri   r%   r   ZHeadingZ
Subheadingrj   ErrorZSymbolr	   r   rm   rn   ro   r
   ZOtherrq   rY   rY   rY   rZ   r      s   %

c               @   s  e Zd ZdZdZdgZdgZdgZej	ej
B ZdZdZdZd	Zd
Zdefdedfdejfeedddejfeedddefeedddejfeeejjfeeefdefdejfdejdfdej fgdej!fdej!dfdej!dfdej!fgdejfdej"fdejdfgdZ#dS )r   zm
    For the `Lean <https://github.com/leanprover/lean>`_
    theorem prover.

    .. versionadded:: 2.0
    ZLeanZleanz*.leanztext/x-lean)=importr   Zopaque_hintZtactic_hintr   ZrenamingZinlineZhidingZexposingZ	parameterZ
parametersZ
conjectureZ
hypothesisr   r   ZvariableZ	variablesr   Zaxiomr   r|   Zuniversealiasr~   ZoptionsZ
precedenceZpostfixrP   Z
calc_transZ
calc_substZ	calc_reflrv   rw   rx   r   evalZcheckexitZcoercionr   Zprivater-   	namespacer   r   r   r   Z	protectedZexposeZexportZ
set_optionZadd_rewriteZextendsrz   Zexamplers   Z	constantsprintZopaqueZ	reducibleZirreducible)r   r   ZPir   r   r/   r   r   Ztaker   r   r!   r    r8   r   r#   r   r   r   Zcalcr   )r%   r&   ):z!=r>   r?   z&&*r   rA   /@r   rI   z-.z->r   z..z...z::z:>rC   z;;rD   z<-rE   z==rF   rH   rR   z||rJ   z=>z<=z>=z/\z\/u   ∀u   Πu   λu   ↔u   ∧u   ∨u   ≠u   ≤u   ≥   ¬u   ⁻¹u   ⬝u   ▸u   →u   ∃u   ℕu   ℤu   ≈   ×u   ⌞u   ⌟u   ≡u   ⟨u   ⟩)r   r   rB   r   r   r   rG   u   ⦃u   ⦄z:=r@   z\s+z/-rO   z--.*?$z\b)rP   rQ   u\   [A-Za-z_α-κμ-ϻἀ-῾℀-⅏][A-Za-z_'α-κμ-ϻἀ-῾⁰-⁹ⁿ-₉ₐ-ₜ℀-⅏0-9]*z\d+rU   rL   z[~?][a-z][\w\']*:z[^/-]z#pushz-/z#popz[/-]z[^\\"]+z\\[n"\\])rV   rO   rL   N)$r\   r]   r^   r_   r`   ra   rb   rc   re	MULTILINEUNICODEflagsrd   re   rf   rg   Zpunctuationr   r   Singler   r   rj   r%   r	   rh   ri   r   r   rl   r
   rp   r   Z	MultilineZEscaperq   rY   rY   rY   rZ   r   {  s>   





)r_   r   Zpygments.lexerr   r   r   Zpygments.tokenr   r   r   r   r	   r
   r   r   r   __all__r   r   r   rY   rY   rY   rZ   <module>
   s   ,
  Y