google-deepmind / alphageometry

Apache License 2.0
4.18k stars 469 forks source link

failed test case? #103

Open shenglih opened 7 months ago

shenglih commented 7 months ago

I tried this test case which i can manually verify it's valid:

a b c = triangle12 a b c; d e f g = centroid d e f g b a c; h = s_angle c b h 30; i = intersection_lt i d h c g a

but when running through DDAR I got the numericals.InvalidLineIntersectError:


  File "<stdin>", line 1, in <module>
  File "/root/code/alphageometry/ddar.py", line 95, in solve
    dervs, eq4, next_branches, added = saturate_or_goal(
  File "/root/code/alphageometry/ddar.py", line 50, in saturate_or_goal
    added, derv, eq4, n_branching = dd.bfs_one_level(
  File "/root/code/alphageometry/dd.py", line 1094, in bfs_one_level
    add = g.add_piece(name, args, deps=deps)
  File "/root/code/alphageometry/graph.py", line 697, in add_piece
    return self.add_cyclic(args, deps)
  File "/root/code/alphageometry/graph.py", line 1524, in add_cyclic
    circle = self.get_new_circle_thru_triplet(p1, p2, p3)
  File "/root/code/alphageometry/graph.py", line 869, in get_new_circle_thru_triplet
    circle.num = nm.Circle(p1=p1.num, p2=p2.num, p3=p3.num)
  File "/root/code/alphageometry/numericals.py", line 409, in __init__
    center = line_line_intersection(l12, l23)
  File "/root/code/alphageometry/numericals.py", line 586, in line_line_intersection
    raise InvalidLineIntersectError
numericals.InvalidLineIntersectError```

does anyone know if this is a known bug in DDAR?
TriedTired99 commented 7 months ago

我尝试了这个测试用例,我可以手动验证它的有效性:

a b c = triangle12 a b c; d e f g = centroid d e f g b a c; h = s_angle c b h 30; i = intersection_lt i d h c g a

但是当运行 DDAR 时我得到了numericals.InvalidLineIntersectError

 File "<stdin>", line 1, in <module>
 File "/root/code/alphageometry/ddar.py", line 95, in solve
   dervs, eq4, next_branches, added = saturate_or_goal(
 File "/root/code/alphageometry/ddar.py", line 50, in saturate_or_goal
   added, derv, eq4, n_branching = dd.bfs_one_level(
 File "/root/code/alphageometry/dd.py", line 1094, in bfs_one_level
   add = g.add_piece(name, args, deps=deps)
 File "/root/code/alphageometry/graph.py", line 697, in add_piece
   return self.add_cyclic(args, deps)
 File "/root/code/alphageometry/graph.py", line 1524, in add_cyclic
   circle = self.get_new_circle_thru_triplet(p1, p2, p3)
 File "/root/code/alphageometry/graph.py", line 869, in get_new_circle_thru_triplet
   circle.num = nm.Circle(p1=p1.num, p2=p2.num, p3=p3.num)
 File "/root/code/alphageometry/numericals.py", line 409, in __init__
   center = line_line_intersection(l12, l23)
 File "/root/code/alphageometry/numericals.py", line 586, in line_line_intersection
   raise InvalidLineIntersectError
numericals.InvalidLineIntersectError```

does anyone know if this is a known bug in DDAR?

I also encountered this problem in the IMO problem. Have you solved this problem?