Porting Turbo Prolog programs to ISO Prolog 
Author Message
 Porting Turbo Prolog programs to ISO Prolog

Is there a reference on how to port programs written in Turbo Prolog to
standard (ISO) prolog?  Specifically, the following code:

domains

naturalNumber = succ(naturalNumber) ; zero

is supposed to define a domain called naturalNumber which contains the
following:

zero
succ(zero)
succ(succ(zero))
etc.

Also,

predicates

test(naturalNumber, integer)

which does some sort of forward declaration for the test/2 predicate,
which takes a naturalNumber and integer as arguments.

Any help would be greatly appreciated.



Thu, 15 Nov 2001 03:00:00 GMT  
 Porting Turbo Prolog programs to ISO Prolog

Quote:

>Is there a reference on how to port programs written in Turbo Prolog to
>standard (ISO) prolog?  Specifically, the following code:

>domains

>naturalNumber = succ(naturalNumber) ; zero

>is supposed to define a domain called naturalNumber which contains the
>following:

>zero
>succ(zero)
>succ(succ(zero))
>etc.

>Also,

>predicates

>test(naturalNumber, integer)

>which does some sort of forward declaration for the test/2 predicate,
>which takes a naturalNumber and integer as arguments.

>Any help would be greatly appreciated.

When porting Turbo Prolog programs to standard Prolog, you should just
comment out the type declarations (everything in the "domains" and
"predicates" sections).

--

WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"



Thu, 15 Nov 2001 03:00:00 GMT  
 Porting Turbo Prolog programs to ISO Prolog

Quote:

>>Is there a reference on how to port programs written in Turbo Prolog to
>>standard (ISO) prolog?  Specifically, the following code:

<snip>

Quote:
>>Any help would be greatly appreciated.

>When porting Turbo Prolog programs to standard Prolog, you should just
>comment out the type declarations (everything in the "domains" and
>"predicates" sections).

There are, of course, other differences, one of the most frequent being the
use of "=" in assignments, which should be replaced by "is".

Quote:
>--

pursuit
>WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"


--
Colin


Internet: http://perso.wanadoo.fr/colin.barker



Thu, 15 Nov 2001 03:00:00 GMT  
 Porting Turbo Prolog programs to ISO Prolog
Jason,

For the type of program you are describing, there is no porting problem and
Fergus' advice is all you need.

Since numbers are involved, just review your code to make sure that you
change the "=" to "is", only in those cases where you want an expression to
be evaluated (not the unification cases).

Regards,

Greg Bourassa

Quote:

> Is there a reference on how to port programs written in Turbo Prolog to
> standard (ISO) prolog?  Specifically, the following code:

> domains

> naturalNumber = succ(naturalNumber) ; zero

> is supposed to define a domain called naturalNumber which contains the
> following:

> zero
> succ(zero)
> succ(succ(zero))
> etc.

> Also,

> predicates

> test(naturalNumber, integer)

> which does some sort of forward declaration for the test/2 predicate,
> which takes a naturalNumber and integer as arguments.

> Any help would be greatly appreciated.



Thu, 15 Nov 2001 03:00:00 GMT  
 Porting Turbo Prolog programs to ISO Prolog

Quote:
> Since numbers are involved, just review your code to make sure that you
> change the "=" to "is", only in those cases where you want an expression to
> be evaluated (not the unification cases).

Currently, I have replaced "=" with "#=".  I'm assuming that the only
difference
between "is" and "#=" is that the latter works only with numbers, right?


Tue, 20 Nov 2001 03:00:00 GMT  
 Porting Turbo Prolog programs to ISO Prolog

Quote:

>> Since numbers are involved, just review your code to make sure that you
>> change the "=" to "is", only in those cases where you want an expression to
>> be evaluated (not the unification cases).

>Currently, I have replaced "=" with "#=".  I'm assuming that the only
>difference
>between "is" and "#=" is that the latter works only with numbers, right?

No.  "#=" is not a standard operator.  Most Prolog systems don't support it.
(Which one are you using?)  In comparison, the "is" operator is a part of
ISO Prolog and is supported by all modern Prolog implementations.

--

WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"



Fri, 23 Nov 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Interfacing Turbo Prolog to Turbo Pascal of Turbo C

2. PDC Prolog/Visual Prolog and ISO Standards

3. Syntex: Turbo Prolog and SWI-Prolog

4. Syntex: Turbo Prolog and SWI-Prolog

5. Learning prolog with Turbo Prolog

6. Linking Turbo Prolog v2.0 with Turbo C

7. Turbo Prolog / Turbo C connecting problem

8. 4 in a row program, in Turbo Prolog?

9. "name" program in Turbo Prolog

10. turbo prolog program

 

 
Powered by phpBB® Forum Software