coq.js 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. Language: Coq
  3. Author: Stephan Boyer <stephan@stephanboyer.com>
  4. Category: functional
  5. Website: https://coq.inria.fr
  6. */
  7. /** @type LanguageFn */
  8. function coq(hljs) {
  9. return {
  10. name: 'Coq',
  11. keywords: {
  12. keyword:
  13. '_|0 as at cofix else end exists exists2 fix for forall fun if IF in let ' +
  14. 'match mod Prop return Set then Type using where with ' +
  15. 'Abort About Add Admit Admitted All Arguments Assumptions Axiom Back BackTo ' +
  16. 'Backtrack Bind Blacklist Canonical Cd Check Class Classes Close Coercion ' +
  17. 'Coercions CoFixpoint CoInductive Collection Combined Compute Conjecture ' +
  18. 'Conjectures Constant constr Constraint Constructors Context Corollary ' +
  19. 'CreateHintDb Cut Declare Defined Definition Delimit Dependencies Dependent ' +
  20. 'Derive Drop eauto End Equality Eval Example Existential Existentials ' +
  21. 'Existing Export exporting Extern Extract Extraction Fact Field Fields File ' +
  22. 'Fixpoint Focus for From Function Functional Generalizable Global Goal Grab ' +
  23. 'Grammar Graph Guarded Heap Hint HintDb Hints Hypotheses Hypothesis ident ' +
  24. 'Identity If Immediate Implicit Import Include Inductive Infix Info Initial ' +
  25. 'Inline Inspect Instance Instances Intro Intros Inversion Inversion_clear ' +
  26. 'Language Left Lemma Let Libraries Library Load LoadPath Local Locate Ltac ML ' +
  27. 'Mode Module Modules Monomorphic Morphism Next NoInline Notation Obligation ' +
  28. 'Obligations Opaque Open Optimize Options Parameter Parameters Parametric ' +
  29. 'Path Paths pattern Polymorphic Preterm Print Printing Program Projections ' +
  30. 'Proof Proposition Pwd Qed Quit Rec Record Recursive Redirect Relation Remark ' +
  31. 'Remove Require Reserved Reset Resolve Restart Rewrite Right Ring Rings Save ' +
  32. 'Scheme Scope Scopes Script Search SearchAbout SearchHead SearchPattern ' +
  33. 'SearchRewrite Section Separate Set Setoid Show Solve Sorted Step Strategies ' +
  34. 'Strategy Structure SubClass Table Tables Tactic Term Test Theorem Time ' +
  35. 'Timeout Transparent Type Typeclasses Types Undelimit Undo Unfocus Unfocused ' +
  36. 'Unfold Universe Universes Unset Unshelve using Variable Variables Variant ' +
  37. 'Verbose Visibility where with',
  38. built_in:
  39. 'abstract absurd admit after apply as assert assumption at auto autorewrite ' +
  40. 'autounfold before bottom btauto by case case_eq cbn cbv change ' +
  41. 'classical_left classical_right clear clearbody cofix compare compute ' +
  42. 'congruence constr_eq constructor contradict contradiction cut cutrewrite ' +
  43. 'cycle decide decompose dependent destruct destruction dintuition ' +
  44. 'discriminate discrR do double dtauto eapply eassumption eauto ecase ' +
  45. 'econstructor edestruct ediscriminate eelim eexact eexists einduction ' +
  46. 'einjection eleft elim elimtype enough equality erewrite eright ' +
  47. 'esimplify_eq esplit evar exact exactly_once exfalso exists f_equal fail ' +
  48. 'field field_simplify field_simplify_eq first firstorder fix fold fourier ' +
  49. 'functional generalize generalizing gfail give_up has_evar hnf idtac in ' +
  50. 'induction injection instantiate intro intro_pattern intros intuition ' +
  51. 'inversion inversion_clear is_evar is_var lapply lazy left lia lra move ' +
  52. 'native_compute nia nsatz omega once pattern pose progress proof psatz quote ' +
  53. 'record red refine reflexivity remember rename repeat replace revert ' +
  54. 'revgoals rewrite rewrite_strat right ring ring_simplify rtauto set ' +
  55. 'setoid_reflexivity setoid_replace setoid_rewrite setoid_symmetry ' +
  56. 'setoid_transitivity shelve shelve_unifiable simpl simple simplify_eq solve ' +
  57. 'specialize split split_Rabs split_Rmult stepl stepr subst sum swap ' +
  58. 'symmetry tactic tauto time timeout top transitivity trivial try tryif ' +
  59. 'unfold unify until using vm_compute with'
  60. },
  61. contains: [
  62. hljs.QUOTE_STRING_MODE,
  63. hljs.COMMENT('\\(\\*', '\\*\\)'),
  64. hljs.C_NUMBER_MODE,
  65. {
  66. className: 'type',
  67. excludeBegin: true,
  68. begin: '\\|\\s*',
  69. end: '\\w+'
  70. },
  71. { // relevance booster
  72. begin: /[-=]>/
  73. }
  74. ]
  75. };
  76. }
  77. module.exports = coq;