ontolog-forum
[Top] [All Lists]

## Re: [ontolog-forum] HOL decidability [Was: using SKOS for controlled val

 To: "[ontolog-forum] " , Rich Cooper Bill Andersen Wed, 13 Oct 2010 15:52:19 -0400
 On Oct 13, 2010, at 01:56 , Rich Cooper wrote:Hi Duane, yes, iterators in software were what I tried to convey there.  There is no function that will iterate the primes.  By pairing each prime in ascending order with any other iterated set, you create unique prime keys for each element of that set, keys that cannot be factored.   Thanks for your inputs,-RichHi RichHere's a fixed precision implementation of a prime iterator, along the lines Chris Menzel described.Enjoy------------package foo;import java.util.Iterator;public class PrimeIterator implements Iterator { private Integer n = 2; @Override public boolean hasNext() { // Thanks to Euclid :-D return true; } private boolean isPrime(Integer n) { Integer i = 2; while (i < n) { if ((n % i) == 0) { // divisible by i < n return false; } i++; } return true; } @Override public Integer next() { while (!isPrime(n)) { n++; } Integer tmp = n; n++; return tmp; } @Override public void remove() { throw new UnsupportedOperationException(); } public static void main(String[] argz) { PrimeIterator iter = new PrimeIterator(); while (iter.hasNext()) { System.out.println(iter.next()); } }} Bill Andersen Highfleet, Inc. (www.highfleet.com)3600 O'Donnell Street, Suite 600Baltimore, MD 21224Office: +1.410.675.1201Cell: +1.443.858.6444Fax: +1.410.675.1204
```
_________________________________________________________________
Message Archives: http://ontolog.cim3.net/forum/ontolog-forum/
Config Subscr: http://ontolog.cim3.net/mailman/listinfo/ontolog-forum/
Unsubscribe: mailto:ontolog-forum-leave@xxxxxxxxxxxxxxxx
Shared Files: http://ontolog.cim3.net/file/
Community Wiki: http://ontolog.cim3.net/wiki/
To join: http://ontolog.cim3.net/cgi-bin/wiki.pl?WikiHomePage#nid1J
To Post: mailto:ontolog-forum@xxxxxxxxxxxxxxxx    (01)

```
 Current Thread Re: [ontolog-forum] HOL decidability [Was: using SKOS for controlled values for controlledvocabulary], (continued)