lean-ja / lean-ja/lean-by-example

declare_syntax_cat の behavior 指定するコード例

Open
#1,604 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

コード例
Dominant language
Lean
Stars
188
Forks
15
Avg merge
9h 8m
Merged PRs (30d)
6

Description

import Mathlib

inductive Animal where | dog

declare_syntax_cat animal
-- Uncomment this line to break the code below
-- syntax "dog" : animal

open Animal in
#check dog

open Animal in
example : Animal := dog

example (a : Animal) : True := by
  cases a
  case dog => trivial

see: >
Keywords in a syntax category are reserved everywhere?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Lean snippet with the syntax "dog" : animal line enabled and compare it with the current behavior. Read the linked Zulip discussion to establish the intended behavior, then document the explanation and a focused code example showing it.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.