I/O

Current state of the art in providing I/O in a pure logic language restricts nondeterminism in I/O-related predicates. This means that modes and other procedural notions have to be taken into account. This approach is not desirable within the focus of our course. Therefore, some less universal primitives have been implemented: There is no direct output, but (the terms of) answer substitutions can be viewed with some viewers. There is no input in GUPU but arbitrary text can be specified as input.
See also the pictoral overview

Output: Viewing answer-substitutions

:- Query.
:- Viewername(Term) <<< Query.
% Term should occur in Query
The <<< Operator is an annotation to the Query. It simply means that for each answer substitution Term should be displayed in the given Format. The most elementary formats are:
:- text(Cs) <<< Query.
Cs is a list of characters. The text is displayed in a separate small window.
:- postscript(Cs) <<< Query.
Cs is a text which is viewed with a postscript viewer.
:- html(Cs) <<< Query.
Cs is a text viewed with a html-viewer.
Based upon these raw output-oriented formats more application specific formats are defined.
:- europastadt(Stadt) <<< Query.
View a European city on a railway map.
:- europa(Strecke) <<< Query.
View a path through the European railway net.
:- harsdörffer(Ts) <<< Query.
View Harsdörffer's thoughtrings.
:- zahlenbrett(M) <<< Query.
View a knight's ride.
:- damenbrett(M) <<< Query.
View queens on a chessboard.
:- lrs(LRs) <<< Query.
View a curve of left and right turns.
:- magquad(M) <<< Query.
View the process of finding a CLP(FD) solution for magic squares
:- nqueens(Ds) <<< Query.
View the process of finding a CLP(FD) solution for the n-queens problem
:- digraph_(Pred,Marks) <<< Query.
View a relation Pred as a digraph with some Marks highlighted.
:- rnafaltung(Faltung) <<< Query.
View a secondary folding of an RNA
:- bridgeplan(DBPlan) <<< Query.
View the schedule of a bridge construction
:- repsched(Schedule) <<< Query.
View the schedule of repetitive tasks
:- wumpusstate(WAH) <<< WA = w(0):ag1/1, WAH= s(WA,_), snapshot_(WAH,Explanation).
View an agent chasing the Wumpus
:- term(T) <<< Query.
Displays T indented as a text.

**NEXT:Conclusion.
[logprog|GUPU|UWN]