Split a list at an entry: by position, in a filtered image, and against the fold before it

Đang mở
#397 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
44/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
backend

Hướng nghiên cứu

Start in Probability.List, then read the related issue #369 and the core lemmas filterMap_eq_append_iff and filterMap_eq_cons_iff. Add the requested split, prefix, and ForallScan lemmas, using the acceptance examples to check them. Done means all four list examples in the acceptance criteria can be proved.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Background

Predicates on transcripts speak of an entry together with the entries before it: a split $l=p\mathbin{+!!+}e::s$. Four facts about such splits are used again and again.

A split is a position, so a property of the splits is decided at the finitely many positions:

\big(\exists\,p\ e\ s,\ l=p\mathbin{+\!\!+}e::s\ \land\ P\,p\,e\big)\iff\big(\exists\,i<|l|,\ P\,(\mathrm{take}\ i\ l)\ l_i\big),
\qquad
\big(\forall\,p\ e,\ p\mathbin{+\!\!+}[e]\ \text{prefix of}\ l\ \to\ Q\,p\,e\big)\iff\big(\forall\,i<|l|,\ Q\,(\mathrm{take}\ i\ l)\ l_i\big).

An entry of a filtered image has a place in the list:

\mathrm{filterMap}\,f\,l=\mathit{pre}\mathbin{+\!\!+}d::\mathit{post}\ \Longrightarrow\ \exists\,l_a\,a\,l_b,\quad l=l_a\mathbin{+\!\!+}a::l_b,\quad \mathrm{filterMap}\,f\,l_a=\mathit{pre},\quad f\,a=\mathrm{some}\ d,

and the same for filter. Last, say that $P$ holds along $l$ from $b$ when every entry $a$ satisfies $P(c,a)$, with $c$ the fold of a step $f$ from $b$ over the entries before $a$. "Each query is valid for the state reached before it" is of this form:

\mathrm{ForallScan}\ b\ l\ \land\ \mathrm{ForallScan}\ (\mathrm{foldl}\,f\,b\,l)\ m\ \Longrightarrow\ \mathrm{ForallScan}\ b\ (l\mathbin{+\!\!+}m),
\qquad
\mathrm{ForallScan}\ b\ (l\mathbin{+\!\!+}a::m)\ \Longrightarrow\ P(\mathrm{foldl}\,f\,b\,l,\ a).
Proposed change

In Probability.List, add List.exists_eq_append_cons_iff, List.forall_prefix_concat_iff_forall_take, List.exists_split_of_filterMap_eq, List.exists_split_of_filter_eq (from core's filterMap_eq_append_iff and filterMap_eq_cons_iff), and List.ForallScan with ForallScan.append and ForallScan.of_append_cons. Related to #369.

Acceptance criteria

Decide whether some entry of [1, 2, 4] is larger than the sum of the entries before it. Split [1, 2, 3, 4] at an entry of its even entries, in the filterMap and the filter form. With a running sum as the fold, check a predicate at each entry of a list split in two.

Ngôn ngữ chính
Lean
Star
3
Fork
0
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
123

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của trailofbits/constructive-cryptography

Tất cả issue của trailofbits/constructive-cryptography

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.