%% Copyright (c) 1995,1996 by the University of Pennsylvania %% %% For information about the distributaion, copying, and modification %% %% of this software, please read the file COPYING located in the root %% %% directory of this distribnutaion. If you did not receive the file %% %% COPYING write to Philip Wickline at the address below. %% %% This program is distributed in the hope that it will be useful but %% %% WITHOUT ANY WARRANTY; without even the implied warranty of %% %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file %% %% COPYING for more details. %% %% For information about the structure of the Terzo lambdaProlog %% %% implementation, see the file src/README in this distribution. Please %% %% address any questions about this code or the Terzo lambdaProlog %% %% implementation to Philip Wickline at . %% %% Author: %% %% Philip Wickline %% % "Magic" printing and reading primitives. module Magic. import Exception. % Exceptions raised by string_to_term type parse_error string -> exn. type type_check_fail string -> exn. type term_to_string A -> string -> o. % term_to_string term X % Generates a string representation of term and unifies % it with X. type string_to_term string -> A -> o. % string_to_term str X % Attempts to parse a term of the the string str and % unifies it with X. Raises type_check_fail if the term % parsed is not of the same type as X, and raises % parse_error if an error occurs during parsing.