Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

EvalOr: x<a || x>a over non-integer types simplifies to true

Đã đóng
#170 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
backend

Hướng nghiên cứu

Start by reading EvalOr.orComparisonTrue and the adjacent notXb1 branch mentioned in the issue. Check how the comparison bounds and allowEquals() are handled for non-integer types, then run the relevant boolean simplifier tests. Done when strict comparisons at an equal bound no longer simplify to true, while the listed integer cases keep their current results.

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

Mô tả

`EvalOr.orComparisonTrue` decides `x <= a || x >= b` with the two bounds only. For mathematically integer bounds on integer types that is right, because the strictness is folded into the bound (`k<3` is stored as `k<=2`, `k>3` as `k>=4`). For non-integer bounds, or integer bounds on a non-integer type, it returns `d0 == d1` without looking at `allowEquals`, so two strict comparisons on the same bound pass as a tautology:

  • `l<2.5 || l>2.5` (l a double) evaluates to `true`; it is false at l == 2.5
  • `l<3.0 || l>3.0` evaluates to `true`
  • `k<3 || k>3` (k an int) correctly stays `k<3||k>=4`
  • `k<=3 || k>=3` correctly becomes `true`

Found while benchmarking the boolean simplifier (the structural isNegationOf work). Not fixed there, since it changes verdicts: the non-integer branch needs `gt0.allowEquals() || gt1.allowEquals()` when the bounds coincide, and `x<a || x>a` should probably become `x != a` as the `notXb1` branch below it already does for the negated form.

🤖 Generated with Claude Code

Ngôn ngữ chính
Java
Star
1
Fork
1
Merge trung bình
1 giờ 55 phút
Pull request đã merge (30 ngày)
8

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

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 CodeLaser/maddi

Tất cả issue của CodeLaser/maddi

Issue tương tự

Thêm issue về Java

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.