Litex:第一种可在1-2小时内学会的正式语言
Litex: The First Formal Language Learnable in 1-2 Hours

原始链接: https://github.com/litexlang/golitex

## Litex:普及形式化推理 Litex 是一种新的开源形式化语言,专为编码推理而设计,旨在实现极高的可访问性。与 Lean 等传统语言不同,Litex 仅需 1-2 小时即可学会,即使没有数学或编程背景。其核心使命是通过降低入门门槛和降低形式化证明的创建成本(降低十倍)来扩展形式化推理的应用范围。 关键区别在于其简洁性:Litex 使用纯粹的推理,避免复杂的语法或关键字,使其对人类和人工智能都具有直观性。正如通过解决多元方程所演示的那样,在 Lean 中需要专家花费数小时才能完成的任务,使用 Litex 可以在几分钟内完成。 Litex 拥有不断壮大的社区和生态系统,包括在线资源、标准库和 Python 集成。它还在人工智能研究中展现出强大的能力,在 GSM8K 数据集上实现了 100% 的准确率,且无需训练,并利用 Litex 驱动的代理进行代码生成。该项目积极鼓励贡献和协作,以构建形式化推理的未来。

相关文章

原文

Litex: The First Formal Language Learnable in 1–2 Hours

Simplicity is the ultimate sophistication.

– Leonardo da Vinci

Litex(website) is a simple, intuitive, and open-source formal language for coding reasoning (Star the repo!). It ensures every step of your reasoning is correct, and is actually the first reasoning formal language (or formal language for short) that can be learned by anyone in 1–2 hours, even without math or programming background.

Making Litex intuitive to both humans and AI is Litex's core mission. This is how Litex scales formal reasoning: by making it accessible to more people, applicable to more complex problems, and usable by large-scale AI systems. These benefits stem from Litex's potential to lower the entrance barrier by 10x and reduce the cost of constructing formalized proofs by 10x, making formal reasoning as natural as writing.

Here is a comparison between Litex and traditional formal language Lean.

Litex Lean 4
let x R, y R:
  2 * x + 3 * y = 10
  4 * x + 5 * y = 14

2 * (2 * x + 3 * y) = 2 * 10 = 4 * x + 6 * y
y = (4 * x + 6 * y) - (4 * x + 5 * y) = 2 * 10 - 14 = 6
2 * x + 3 * 6 = 10
2 * x + 18 - 18 = 10 - 18 = -8
x = (2 * x) / 2 = -8 / 2 = -4

import Mathlib.Tactic

example (x y : ℝ) (h₁ : 2 * x + 3 * y = 10) (h₂ : 4 * x + 5 * y = 14) : x = -4 ∧ y = 6 := by
  have h₃ : 2 * (2 * x + 3 * y) = 2 * 10 := by rw [h₁]
  have h₄ : 4 * x + 6 * y = 20 := by linear_combination 2 * h₁
  have h₅ : (4 * x + 6 * y) - (4 * x + 5 * y) = 20 - 14 := by
  rw [h₄, h₂]
  have h₆ : (4 * x + 6 * y) - (4 * x + 5 * y) = y := by
  ring
  have h₇ : 20 - 14 = 6 := by norm_num
  have h₈ : y = 6 := by
  rw [←h₆, h₅, h₇]
  have h₉ : 2 * x + 3 * 6 = 10 := by rw [h₈, h₁]
  have h₁₀ : 2 * x + 18 = 10 := by
  rw [mul_add] at h₉
  simp at h₉
  exact h₉
  have h₁₁ : 2 * x = -8 := by
  linear_combination h₁₀ - 18
  have h₁₂ : x = -4 := by
  linear_combination h₁₁ / 2
  exact ⟨h₁₂, h₈⟩

Even Kids can formalize the multivariate equation in Litex in 2 minutes, while it require an experienced expert hours of work in Lean 4. It is a typical example of how Litex lowers the entrance barrier by 10x, lowers the cost of constructing formalized proofs by 10x, making formalization as easy and fast as natural writing. No foreign keywords, no twisted syntax, or complex semantics. Just plain reasoning.

The best way to predict future is to create it.

-- Alan Kay

Litex is nothing without its community and technical ecosystem.

Resources for Litex users:

  1. Our official website contains tutorials, cheat sheets, examples, documentation, collaboration opportunities, and more for Litex. All documents on our website are open-sourced here
  2. Learn Litex online. A short list of major Litex statements and their usage are shown in the cheat sheet.
  3. You can run litex on your own computer, start from here
  4. Litex standard library is under active development. Contribute to it and earn impact rewards!
  5. Use pylitex to call Litex in Python
  6. Our Community is on Zulip!
  7. Email us here.

Resources for AI researchers who want to develop Litex-based AI systems, mostly developed by the Litex open-source community:

  1. Litex achieves 100% accuracy on gsm8k dataset without any training Github
  2. Litex Dataset is on Hugging Face. Contribute to it and earn impact rewards!
  3. Here is a really powerful Litex Agent Github. It is so powerful that much code in our standard library is generated by it!
  4. AI researchers interested in Litex might find Litex LLM Dev useful. Contact us if you are interested in collaborating on this project!

All of our repositories are open-sourced. Just issue PRs and tell us any ideas about Litex! Maybe we can build the future together!

Sometimes it is the very people who no one imagines anything of who do the things that no one can imagine.

– Alan Turing

The Litex Logo

Litex Mascot: Little Little O, a curious baby bird full of wonder

Hi, I’m Jiachen Shen, creator of Litex. It is so fortunate to receive tremendous help from friends and colleagues throughout this journey of designing, implementing, and growing Litex into a community. Without their support, Litex would not have had the chance to succeed.

I owe special thanks to my friend Zhaoxuan Hong, who built Litex’s powerful toolchains and has supported the project from the very beginning. I am also deeply grateful to Siqi Sun, Wei Lin, Peng Sun, Jie Fu, Zeyu Zheng, Huajian Xin, Zijie Qiu, Siqi Guo, Haoyang Shi, Chengyang Zhu, Chenxuan Huang for their invaluable contributions. I am certain this list of special thanks will only grow longer in the future.

联系我们 contact @ memedata.com