AgentBase   AgentBase for SICStus
Components for Internet Programming
Version 2001-0.2-alpha

AgentBase Home > examples: logic_server.pl

  OVERVIEW
  Introduction
Download
Installation
FAQ

  EXAMPLES
  Web Server + CGI
Prolog + Java
Prolog + Java Applets
Applet Logic Monitor
Query-Eval via Telnet

  COMPONENTS
  Generic Server
HTTP Support
HTML Support
JEval Java Interface
Utilities

  RELATED
  SICStus Prolog Home
AgentBase 0.1-alpha


Page Formatted for Printing

Query Eval via Telnet

This is a simple example of a logicserver that allow users to enter prolog queries via telnet.

Instructions

1. Change directory to examples/logicserver/ and start the example with

sicstus -l logicserver

The logicserver will display the telnet port. An example:

Please telnet to 53958

2. start a telnet session to the host and port (the port from step 1). On UNIX: telnet host port. In the above example it would look like:

>telnet localhost 53958
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Welcome to SICStus logicserver (single lines only)
| ?- X = 5, Y = 134, Z is X * Y.

X = 5
Y = 134
Z = 670
yes
| ?- 

Note that this will open up your computer for others. Anyone that knows about this logic monitor can enter prolog terms that will be called - for example 'halt.' or 'system:system('format C:')'

The source code for this example: logicserver.pl.


Copyright © 2001 SICS AB, All Rights Reserved.
For more information about AgentBase please email agentbase@sics.se.