New arithmetic functions programmed in MINERVA are used exactly ...
Move to
=> <=
Darueber Spitze
See also
Invocation
Predicates
Directives
Arithmetic
Functions
Objects
Error Messages
File Names
main
Packages
Debugger
Internationalization
Gui Programming
MINERVA to Java Interface
Java to MINERVA Interface
Restrictions
IF Computer > MINERVA > Manual > Reference > Arithmetic

Arithmetic

New arithmetic functions programmed in MINERVA are used exactly as built in functions.

This allows both functional and relational notations for arithmetic expressions.

MINERVA predicates for arithmetic evaluation, e.g. is/2 used on a function like "Result = f(A,...,N)" will search for a predicate "f(A,...,N,Result)".

Thus arithmetic in MINERVA becomes easier to read and uses aggresive variable hiding.

% example: compute the cost for industrial urethane foam

% notation as relations a(Price) :- height(H), width(W), depth(D), unit_price_per_volume(U), Price is H * W * D * U.

% notation as functions

b(Price) :- Price is height * width * depth * unit_price_per_volume.

% uniform notation of functions resp. data base

height(6). depth(38). width(75). unit_price_per_volume(0.01).

Here is the result for the above program:

?- a(Price).

Price = 171.0

yes

?- b(Price).

Price = 171.0

yes

?-

read on...
MINERVA
ifcomputer logo
f
Expert Services on the Web
Sprache
English
Japanese
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Arithmetic/home_de.html
published 2008/7/21 update 2002/3/20 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 info@ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS