alphageometry icon indicating copy to clipboard operation
alphageometry copied to clipboard

code error!

Open asyua-ye opened this issue 10 months ago • 0 comments

in alphageometry.py try_translate_constrained_to_construct()

  for prem in prems:
    name, *args = prem

    if point not in args:
      return f'ERROR: {point} not found in predicate args.'

    if not check_valid_args(pt.map_symbol(name), args):
      return 'ERROR: Invalid predicate ' + name + ' ' + ' '.join(args)

    for a in args:
      if a != point and a not in existing_points:
        return f'ERROR: point {a} does not exist.'

    try:
      name, args = translate_constrained_to_constructive(point, name, args)
    except:  # pylint: disable=bare-except
      return 'ERROR: Invalid predicate ' + name + ' ' + ' '.join(args)

    if name == 'on_aline':
      if args.count(point) > 1:
        return f'ERROR: on_aline involves twice {point}'

    constructions += [name + ' ' + ' '.join(args)]

in check_valid_args(pt.map_symbol(name), args):

  elif name == 'eqangle':
    if len(args) != 8:
      return False
    a, b, c, d, e, f, g, h = args
    if len({a, b, c, d}) < 3:
      return False
    if len({e, f, g, h}) < 3:
      return False

in translate_constrained_to_constructive(point, name, args):

  elif name in ['^', 'eqangle']:
    a, b, c, d, e, f = args

    if point in [d, e, f]:
      a, b, c, d, e, f = d, e, f, a, b, c

    x, b, y, c, d = b, c, e, d, f
    if point == b:
      a, b, c, d = b, a, d, c

    if point == d and x == y:  # x p x b = x c x p
      return 'angle_bisector', [point, b, x, c]

    if point == x:
      return 'eqangle3', [x, a, b, y, c, d]

    return 'on_aline', [a, x, b, c, y, d]

In the displayed check_valid_args(pt.map_symbol(name), args), the code content contradicts that of translate_constrained_to_constructive(point, name, args). The error in the latter would prevent the language model from ever outputting the three auxiliary constructions during testing. Has anyone reproduced the results in the paper? Could this issue in the code affect the test results?

asyua-ye avatar Mar 30 '25 15:03 asyua-ye