Abstract

We give the first linear time (randomised) algorithm for thefirst order isomorphism problem, that is, the isomorphism of non-recursive types involving product- and function-type constructors, under the axioms of commutativity and associativity of products, currying and distributivity of functions over products. This problem can also be thought of as the problem of formal equality-testing of multi-variate expressions involving only multiplications and exponentiation. Previous work gave a deterministicO(nlog2n) time andO(n) space algorithm for the problem (nbeing the input size). Our specific contribution includes two randomised algorithms for the problem:(i)anO(n) timeMonte Carloalgorithm (that is, with a small probability it may decide erroneously that the two types are isomorphic), and(ii)anO(nlogn) expected time andO(n) spaceLas Vegasalgorithm (that is, with a small probability it may execute long).The algorithms rely on a preprocessing stage, which computes the sequence of the firstnprimes inO(nlogn/log logn) time and space.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call