[isabelle-dev] Proper sign of gcd / lcm on type int
makarius at sketis.net
Wed Jun 1 21:57:02 CEST 2016
On 01/06/16 21:27, Florian Haftmann wrote:
> Note that the mixed signs of PolyML.IntInf.lcm maintain the property
> gcd a b * lcm a b = a * b
> whereas the lcm in GCD.thy obeys
> gcd a b * lcm a b = normalize a * normalize b
> which emphasises the dual nature of the gcd/lcm lattice.
> Both are ok in my view; ironically, lcm is used more often in
> Isabelle/ML than gcd. Providing an lcm in the manner of HOL is trivial,
> Integer.gcd = PolyML.gcd
> Integer.lcm = abs oo PolyML.lcm
These two lines are the plan. Is that a good one or a bad one?
Presently, I have used PolyML.IntInf.gcd and PolyML.IntInf.lcm for
rat.ML (see da38571dd5bd). It somehow violates our cozy Isabelle/ML
library environment to refer to structure PolyML.
BTW, AFP has special code generator setup for PolyML.IntInf.gcd here:
Luckily, this is only gcd and not lcm, so it coincides already.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: OpenPGP digital signature
More information about the isabelle-dev