U
    YShE                     @   s   d Z ddlmZ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mZ ddlmZ ddgZG dd deZG dd deZd	S )
a  
    pygments.lexers.theorem
    ~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for theorem-proving languages.

    See also :mod:`pygments.lexers.lean`

    :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
    )
RegexLexerbygroupsdefaultwords)
TextCommentOperatorKeywordNameStringNumberPunctuationGeneric
Whitespace)	LeanLexerCoqLexerIsabelleLexerc                   @   s  e Zd 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efdejjfdedfdefdejfdeejeejfdejdfdej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 d"e d&e e"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d0e)j+d1fd2efd3ejjfgdefd4ejfd0e)j+d1fd5e#j$fd6e,d7fgdefd8efd9e"fd:efd(e#j$fd)e#j%fdedfd6e,d7fgd;efded<fd=ed7fd>efgd?e)j+fd@e)j+fd0e)j+d7fgdefd6e,fdAejfdBej-d7fdCed7fe.d7gdDZ/dEdF Z0d#S )Gr   z%
    For the Coq theorem prover.
    Coqzhttp://coq.inria.fr/coqz*.vz
text/x-coqz1.5r   )cZSectionModuleZEndZRequireImportZExportIncludeVariable	Variables	ParameterZ
ParametersZAxiomZAxiomsZ
HypothesisZ
HypothesesZNotationZLocalZTacticReservedZScopeZOpenCloseZBindZDeclareZDelimitZ
DefinitionZExampleZLetZLtacZLtac2ZFixpointZ
CoFixpointZMorphismZRelationZImplicit	ArgumentsZTypesZ
ContextualZStrictZPrenexZ	ImplicitsZ	InductiveZCoInductiveZRecordZ	StructureZVariantZ	CanonicalZCoercionZTheoremZLemmaZFactZRemarkZ	CorollaryZPropositionPropertyZGoalProofZRestartZSaveQedZDefinedZAbortZAdmittedZHintZResolveZRewriteZViewZSearchZComputeZEvalZShowZPrintZPrintingZAllZGraphZProjectionsZinsideZoutsideZCheckGlobalInstanceClassZExistingZUniverseZPolymorphicZMonomorphicContextSchemeFromZUndoZFailFunctionZProgramElpiZExtractZOpaqueZTransparentZUnshelvezNext Obligation)forallexistsZexists2funfixZcofixstructmatchendinreturnletifisthenelseforZofZnosimplwithas)TypeZPropZSPropSet)CZposesetmovecaseZelimapplyclearZhnfZintroZintrosZ
generalizerenamepatternafterZdestructZ	inductionusingZrefineZ	inversionZ	injectionZrewriteZcongrunlockZcomputeringfieldreplacefoldZunfoldZchangeZ
cutrewriteZsimplhavesuffZwlogZsufficesZwithoutZlossZnat_normassertcutZtrivialrevertZ
bool_congrZ	nat_congrZsymmetryZtransitivityautosplitleftrightZautorewritetautoZsetoid_rewriteZ	intuitionZeautoZeapplyZeconstructorZetransitivityconstructorZerewriteredZcbvlazyZ
vm_computeZnative_computeZsubst)bynowdoneexactZreflexivityrS   ZromegaomegaZliaZniaZlraZnraZpsatzZ
assumptionZsolveZcontradictionZdiscriminateZ
congruenceZadmit)dolastfirsttryZidtacrepeat);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lp:\{\{z\|z\|]z\}~z=>z/\\z\\/z\{\|z\|\}u   λ   ¬u   ∧u   ∨u   ∀u   ∃u   →u   ↔u   ≠u   ≤u   ≥z[!$%&*+\./:<=>?@^|~-]z[!?~]z[=<>@^|&+\*/$%-]\s+zfalse|true|\(\)|\[\]\(\*commentz'\b(?:[^\W\d][\w\']*\.)+[^\W\d][\w\']*\bz\bEquations\b\??zM\b(Elpi)(\s+)(Program|Query|Accumulate|Command|Typecheck|Db|Export|Tactic)?\bz,\bUnset\b|\bSet(?=[ \t]+[A-Z][a-z][^\n]*?\.)set-optionsz\b(?:String|Number)\s+Notationsn-notation\bprefixsuffixz\b([A-Z][\w\']*)z({})|N(z)?z[^\W\d][\w']*z\d[\d_]*0[xX][\da-fA-F][\da-fA-F_]*0[oO][0-7][0-7_]*0[bB][01][01_]*z(-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)z7'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'z'.''"stringz[~?][a-z][\w\']*:z\Sz[A-Z]\w*z\d+re   #popz*\b(?:via|mapping|abstract|warning|after)\bz=>|[()\[\]:,]z'\b[^\W\d][\w\']*(?:\.[^\W\d][\w\']*)*\bz([^(*)]+|\*+(?!\)))+#push\*\)[(*)]z[^"]+z""z[A-Z][\w\']*(?=\s*\.)z[A-Z][\w\']*z[a-z][a-z0-9_\']*)rootrt   ru   rs   r   Zdottedc                 C   s   d| krd| krdS d S )Nr    r       )textr   r   J/root/rtd-docs/venv/lib/python3.8/site-packages/pygments/lexers/theorem.pyanalyse_text   s    zCoqLexer.analyse_text)1__name__
__module____qualname____doc__nameurlaliases	filenames	mimetypesversion_addedflagsZ	keywords1Z	keywords2Z	keywords3Z	keywords4Z	keywords5Z	keywords6Zkeyopts	operatorsZprefix_symsZ
infix_symsr   r
   BuiltinPseudor   r	   	Namespacer   r   r:   r   formatjoinr   r   IntegerHexOctBinFloatr   CharDoubler   r#   r   tokensr   r   r   r   r   r      s   	




(


Pc                    @   s  e Zd 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Zdefdedfdej 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-j&fd%e.j/fd&e.j0fd'e.j1fd(ed)fd*ej2d+fd,e-fgd-efded.fd/ed0fd1efgd2efdej d.fd ed.fd3ej d0fd4ed0fd#ej fd5efgd6efd#ej fd7efd8efd(ed0fgd9ej2fd#ej fd:ej2fd8ej2fd*ej2d0fgd;Z3d<S )=r   z+
    For the Isabelle proof assistant.
    Isabellezhttps://isabelle.in.tum.de/isabellez*.thyztext/x-isabellez2.0)2andZassumesattachZavoidsZbinderZcheckingZclass_instanceZclass_relationZcode_moduleZcongsZconstantZ
constrainsZ	datatypesZdefinesfilefixesr7   Z	functionshints
identifierr3   Zimportsr0   ZincludesZinfixZinfixlZinfixrr4   keywordsrV   module_nameZmonosZ	morphismsZno_discs_selsnotesZobtainsopenoutputZ
overloadedZ
parametricZ
permissiveZ	pervasiveZ
rep_compatZshowsZ	structureZ
type_classZtype_constructor	unchecked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nitpick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_coercions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_rulesproppwdZ
quickcheckZrefuteZsledgehammerZ
smt_statusZsolve_directZspark_status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subsubsectionsectZsubsectZ
subsubsect)ZMLZML_fileZ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contextdatatypeZdatatype_newZdatatype_new_compatZdeclarationZdeclareZdefault_sortZdefer_recdefZ
definitionZdefs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_mapZ	inductiveZinductive_setZinstantiationZjudgmentZlemmasZlifting_forgetZlifting_updateZlocal_setuplocaleZmethod_setupZnitpick_paramsZno_adhoc_overloadingZno_notationZ	no_syntaxZno_translationsZno_type_notationZnominal_datatypeZnonterminalnotationZnotepad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_params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
statespacesyntaxZsyntax_declarationr   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_axiomatization	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_specificationbnfZ	code_predZ	corollaryZcpodefZcrunchZcrunch_ignoreZenriched_typefunctioninstanceZinterpretationZ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_vcspecificationsubclassZ	sublocaleZterminationZtheoremZtypedefZwrap_free_constructors)rW   rY   Zqed)ZsorryZoops)rJ   ZhenceZ	interpret)nextZproof)finallyfromr5   Z
ultimatelyr8   )ZML_prfZalsoincludeZ	includingr2   ZmoreoverZnotetxtZtxt_rawZ	unfoldingrD   write)Zassumer>   defr,   Zpresume)guessobtainshowZthus)r?   Z	apply_endZapply_tracebackZdeferZprefer)rg   rf   r|   )[rl   rm   rj   rc   rz   +rd   !?){}.z..rq   rr   rs   z\\<open>r   u   \{\*|‹rv   rw   z\\<(\w|\^)*>z'[^\W\d][.\w']*r}   r~   r   r   r   rn   factz/[^\s:|\[\]\-()=,+!?{}._][^\s:|\[\]\-()=,+!?{}]*z[^(*)]+r   r   r   r   u   [^{*}\\‹›]+z	\\<close>u   \*\}|›z[{*}\\]z[^"\\]+z\\"z\\z[^`\\]+z\\`)r   rs   r   r   r   N)4r   r   r   r   r   r   r   r   r   r   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_scriptr   Zproof_operatorsr   r   r   Symbolr   r   Wordr	   r   r:   r   Heading
Subheadingr   Errorr   r
   r   r   r   r   Otherr   r   r   r   r   r      s   &


0



N)r   Zpygments.lexerr   r   r   r   Zpygments.tokenr   r   r   r	   r
   r   r   r   r   r   Zpygments.lexers.leanr   __all__r   r   r   r   r   r   <module>   s   0 .