• Keine Ergebnisse gefunden

Modified Program:

N/A
N/A
Protected

Academic year: 2021

Aktie "Modified Program:"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Program:

sqr(X,Y) :- Y is X*X.

sqr :- nl, write(’Please enter a number or "stop": ’), nl, read(X),

proc(X).

proc(stop) :- !.

proc(X) :- sqr(X,Y),

write(’The square of ’), write(X), write(’ is ’), write(Y), sqr.

Query:

?- sqr.

Please enter a number or "stop":

|: 3.

The square of 3 is 9

Please enter a number or "stop":

|: -4.

The square of -4 is 16

Please enter a number or "stop":

|: stop.

true.

37

(2)

Modified Program:

sqr(X,Y) :- Y is X*X.

start :- nl, write(’Please enter the name of an input file: ’), nl, read(Inputfile),

nl, write(’Please enter the name of an output file: ’), nl, read(Outputfile),

see(Inputfile), tell(Outputfile), sqr,

seen, told.

sqr :- read(X), proc(X).

proc(end_of_file) :- !.

proc(X) :- sqr(X,Y),

write(’The square of ’), write(X), write(’ is ’), write(Y), nl,

sqr.

38

Referenzen

ÄHNLICHE DOKUMENTE

Control words from the calling program specify the data channel to be sampled, meter function (type of measurement), meter mode (measurement or calibration check),

The HP Program Catalog is presented to you as a reference to all Assembly, FORTRAN and ALGOL programs cur- rently available from the Hewlett-Packard Software

In addition, a file may be bypassed during the running of the program under sense switch control (SSe). A continuous field up to 30 characters in length may be

In converting the operands to an output data stream, numerous checking and utility functions are performed such as computing, checking and translating Set Buffer

These four functions are (1) data migration, which moves less active data sets off primary volumes, (2) recall, which moves migrated data sets back to primary volumes,

It was found, that KlenTaq DNA polymerase is able to incorporate all tested modified nucleoside triphosphates comparable to the natural counterpart (see Figure

In addition to rules for reasoning about Hoare triples, Hoare logic needs a base logic to reason about assertions, e.g. That is, strictly speaking, FOL formulas are part of

8.3 Formalization and soundness of the Hoare logic 8.4 Program verification with Isabelle/HOL.. 8.5 Verifying procedural, heap-manipulating programs 8.6 Software