8000 Potential bug in the second downpass · Issue #17 · mbrazeau/MorphyWeb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Potential bug in the second downpass #17
Open
@TGuillerme

Description

@TGuillerme

There might be a potential problem of a logical branch of the second downpass that don't get triggered (i.e. missing an else condition) - at least in the R implementation of the algorithm that was the case.

In the second downpass around lines 323-339:

  if (n_final[i] & MORPHY_IS_APPLICABLE) {
            
            if ((temp = (lft_char[i] & rt_char[i]))) {
                
                if (temp & MORPHY_IS_APPLICABLE) {
                    n_final[i] = temp & MORPHY_IS_APPLICABLE;
                }
                
            } else {
                n_final[i] = (lft_char[i] | rt_char[i]) & MORPHY_IS_APPLICABLE;
            }
            
            regionactive[i] |= (lreg_active[i] | rreg_active[i]);
        }
        else {
            regionactive[i] = 0;
        }

The third condition ( if (temp & MORPHY_IS_APPLICABLE)) has no else condition: when the state in common between left and right ((lft_char[i] & rt_char[i])) is the inapplicable token, n_final is not modified (note that this might not be a problem since in Morphy, not all the passes are saved).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0