% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % File: qnodexx.dtr % % Purpose: Simple test theory for Qnode facility in DATR % % Author: Gerald Gazdar, July 1994 % % Email: geraldg@cogs.sussex.ac.uk % % Address: COGS, Sussex University, Brighton BN1 9QH, UK % % Version: 1.0 % % % % Copyright (c) University of Sussex 1994. All rights reserved. % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % The Qnode name *always* denotes the query node. Thus, in simple DATR % theories, it duplicates the function of quoted paths, but in DATR % theories that change the global context through the use of a quoted % node or quoted node-path pair, the Qnode allows you to access the % identity of the original query node which would otherwise be lost. % Syntactically, once declared, the Qnode behaves exactly like any % other node name except, of course, that it cannot appear as the name % of a defined node (the compiler needs to flag an error if the user % tries to do this). Semantically, the Qnode can be thought of as a % synonym of the query node that is added dynamically (and subsequently % retracted) as each query is evaluated (one can implement it this way). # qnode MyQnodeName. Top: == "" == MyQnodeName:. Middle: <> == Top == middle x-value. Terminal1: <> == Middle == terminal 1 x-value. Terminal2: <> == "Middle" == terminal 2 x-value. % The relevant theorems: % % Terminal1: % = terminal 1 x-value % = terminal 1 x-value. % % Terminal2: % = middle x-value % = terminal 2 x-value. % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % # hide Top Middle. # show . % The next line is the Revision Control System Id: do not delete it. % $Id: archive.dtr,v 1.1 1997/04/09 20:40:33 root Exp $