amnh / PCG

𝙋𝙝𝙮𝙡𝙤𝙜𝙚𝙣𝙚𝙩𝙞𝙘 𝘾𝙤𝙢𝙥𝙤𝙣𝙚𝙣𝙩 𝙂𝙧𝙖𝙥𝙝 ⸺ Haskell program and libraries for general phylogenetic graph search
28 stars 1 forks source link

The dynamic character analysis is broken for the L1-norm (additive) #78

Closed recursion-ninja closed 5 years ago

recursion-ninja commented 5 years ago

When a dynamic character is input that uses the L1 norm (additive) metric, runtime exceptions are thrown regarding the specialized handling of this metric. I assume that the error exists in the Ranged instance definition of the DynamicCharacterElement. We need to correct the instance definition (or the calling code) so that this is handled appropriately.

recursion-ninja commented 5 years ago

There appears to be a defect in the decoding from the alphabet.

Alphabets = [ "A", "B", "C" ]

and there exists something like this in the parse result:"AB":[]

We get the empty bitvector when decoding this because notElem "AB" [ "A", "B", "C" ].

Boarders commented 5 years ago

The example in the integration test fails as the read grammar is not specific enough to be able to specify reading the file as a particular alphabet, e.g. protein, instead of as a custom alphabet. The same problem appears in the Sankoff example here https://github.com/amnh/PCG/issues/80.

recursion-ninja commented 5 years ago

I corrected a defect in the bit-vector arithmetic used when converting between characters and ranges.

See commit 5e4401e.