Xuanrui Qi

I am a graduate student at the Graduate School of Mathematics, Nagoya University, in Nagoya, Japan. I am interested in a wide range of topics in theoretical computer science and mathematics, most particularly those related to typed lambda calculi, mathematical logic, and categorical structures. Currently, my research advisor is Professor Jacques Garrigue.

I am also a formal methods consultant and freelance software engineer, experienced in engineering formal proof and building working software systems with OCaml and Haskell.

Prior to this, I was:

  • an intern (summer 2019), then a part-time contract engineer with Murali Vijayaraghavan at SiFive, working on the Kami project, towards the goal of verifying a realistic RISC-V processor in Coq;
  • a research visitor here at Nagoya, with Professor Jacques Garrigue, in summer 2018, working on the verification of succinct data structures in Coq;
  • a research assistant on the Elephant Tracks project, under Professor Samuel Z. Guyer at the Department of Computer Science, Tufts University;
  • a student at Tufts University, from which I received a M.S. in Computer Science and a B.S. As an undergraduate, I majored in computer science and international relations, and minored in mathematics.

For more details, please refer to my curriculum vitae (last updated May 10, 2020).

I am welcome to offers for consulting and contracting work! My main field of expertise is in formal methods, software correctness, and high-assurance software (especially proof engineering in the Coq theorem prover), but I am also experienced in engineering and developing programming language infrastructure and runtime, as well as in general software development in OCaml and Haskell. Please consult me for your verification needs! If you are interested, you may want to look at my résumé, and shoot me an email at me@xuanruiqi.com!

Contact Information

Address: Graduate School of Mathematics, Nagoya University, Furo-cho, Chikusa-ku, Nagoya, Aichi, Japan 464-8602
E-mail: me@xuanruiqi.com (general use), xuanrui@nagoya-u.jp (for research-related & academic communication)
ORCID: 0000-0002-2032-1552
Twitter: @xuanruirqi
GitHub: xuanruiqi
Keybase: xuanruiqi
GPG (public key): download and import, or do: gpg --recv-keys 87F900026E06FBC8

Recent Activities

  • June-July 2020: I attended PLDI 2020, IJCAR/FSCD 2020 & and LICS/ICALP 2020 virtually.
  • Nov 18-19, 2019: I attended the 15th TPP meeting at the National Institute of Informatics in Tokyo.
  • Sept 8-12, 2019: I attended ITP 2019 and the Coq Workshop 2019 in Portland, Oregon. I gave a talk on our experience in type-driven development in Coq, and Jacques presented our paper on formalizing succinct data structures in Coq.
  • July 2, 2019: our talk proposal on type-driven development of correct tree algorithms in Coq has been accepted to the Coq Workshop 2019!
  • June 1, 2019: our paper, "Proving Tree Algorithms for Succinct Data Structures" (coauthored with Reynald Affeldt, Jacques Garrigue, and Kazunari Tanaka), has been accepted to ITP 2019!


Main Interests

I have a variety of research interests, both in theoretical computer science and (pure) mathematics.

Computer science
  • Type inference for generalized algebraic data types (GADTs)
  • Bidirectional type checking and constraint-based type inference
  • Type theory for mathematical reasoning, and homotopy type theory
  • Formalizing mathematics and computational structures in the Coq proof assistant

I am especially interested in "abstract", or perhaps "Grothendieck-style" mathematics. I like to study and use categorical structures in the context of other fields of mathematics, most particularly algebraic geometry. Broadly speaking, the areas/lines of research I am most interested in are:

  • Topos theory and categorical logic
  • Categorical structures and higher structures in algebraic geometry
  • Synthetic ("internal logic") approach to mathematics, particularly algebraic geometry

Current Projects

Past Projects

Publications & Presentations

Papers & Drafts

Proving Tree Algorithms for Succinct Data Structures
10th International Conference on Interactive Theorem Proving (ITP 2019)
Reynald Affeldt, Jacques Garrigue, Xuanrui Qi, and Kazunari Tanaka
[DOI] [PDF] [Local Copy] [Slides] [Proofs]

Elephant Tracks II: Practical, Extensible Memory Tracing
Senior Honors Thesis, Tufts University, 2018
Xuanrui (Ray) Qi
[PDF] [Defense Slides] [Code]

Talk Materials & Extended Abstracts

Experience Report: Type-Driven Development of Certified Tree Algorithms in Coq
The Coq Workshop 2019
Reynald Affeldt, Jacques Garrigue, Xuanrui Qi, and Kazunari Tanaka
[Extended Abstract] [For On-Screen Reading] [Slides]

From Tactics to Structure Editors for Proofs.
Off the Beaten Track 2019 (OBT 2019)
Xuanrui (Ray) Qi
[Extended Abstract] [Slides]

A Practical and Extensible Framework for Garbage Collection Tracing
SPLASH 2018 Student Research Competition
Xuanrui (Ray) Qi
[Extended Abstract (PDF)]


Over the course of many years, I created some software, mainly for personal use, but maybe also of public interest:

  • Grading tool (currently unnamed): a set of scripts to help automate the task of remote grading & grade management. Put grades in YAML files, and get grade summaries & grading emails sent out automatically.
  • initramfs rebuild script for Arch Linux: a script that mimics the behavior of mkinitcpio -P for Dracut users.
  • DynRuby: a JavaScript tool to display ruby annotations on hover. You can find a demo here.
  • RubyPP: ruby annotation preprocessor for Markdown. Converts ruby annotated Markdown to GitHub flavored markdown.

Of course, I create some more serious software for my research. These can be found in the corresponding section.

I am a functional programmer. My programming language of choice is OCaml, but I sometimes also code in Haskell, and to a lesser extent in Idris and Erlang. In the rare occasion that I code imperatively, I usually use Ruby or sometimes Python. My editor of choice is the glorious Emacs, despite that it is well known that ed is the standard and the best text editor. My operating system of choice is Arch Linux: please see my Linux page for my engagements in the Linux community.


My Erdős number is at most 5, via the shortest known collaboration path: Reynald Affeldt, Naoki Kobayashi, Magnús M. Halldórsson, Márió Szegedy, Paul Erdős. I do not have a Bacon number, as I have never appeared in a film as of yet.

I prefer to be referred to by the singular they, especially in a professional setting, but I am fine with he.

In an English language setting, I often prefer to just be called "Ray". Professionally, I use my full legal name. My name is written 亓璇睿 in Chinese characters (hanzi/kanji), and in Mandarin (technically, "modern standard Mandarin") it is pronounced /tɕʰi˧˥ ɕɥɛn˧˥ ɻwei̯˥˩/ (IPA) . I find the best approximation (modulo tones) to be the Japanese katakana: チー・シュエンルイ. If you can read Hanyu Pinyin or Bopomofo (Zhuyin Fuhao), it is pronounced [qí xuán ruì] or [ㄒㄧˊ ㄏㄩㄢˊ ㄖㄨㄟˋ].

By the way, even most native Chinese speakers cannot read the Chinese characters in my name, as my surname is an extremely rare one (by Chinese standards). There are about 130,000 people with my surname, and it is believed that my family is descended from the family of Confucius' wife, Lady Qiguan (亓官氏).