Wild_Life Interpreter Version 2.19 Sat Jul  9 17:31:08 CDT 2016
Copyright (C) 1991-93 DEC Paris Research Laboratory
Extensions, Copyright (C) 1994-1995 Intelligent Software Group, SFU
X interface not installed.
 Uncommented DJD 2.13

non_strict(public) ? %% BD June 10 1993

public(public)?
public(str2psi)?
public(c_op)?
public(xfy)?
public(xfx)?

public(yfx)?  %% BD June 10 1993
public(fx)?
public(fy)?
public(xf)?
public(yf)?

public(set_module)?
public(open_module)?


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% S Y N T A X

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

set_module("syntax")?
built_ins#open_module("built_ins")?

% The problem guys:
c_op(1000,xfy,',')?
c_op(700,xfx,=)?


A=str2psi("{"),public(A)?
A=str2psi("}"),public(A)?
A=str2psi("["),public(A)?
A=str2psi("]"),public(A)?

% A=str2psi("("),public(A)?
% A=str2psi(")"),public(A)?
% A=str2psi("?"),public(A)?

A=str2psi("."),public(A)?
A=str2psi(","),public(A)?
A=str2psi("{}"),public(A)?


public(

'!', '#', '$<', '$>', '$>=', '$\==', '&', '*', '+', ',', '-', '->', '/',
'//', '/\', ':', ':-', '::', ':<', ':=', ':=<', ':==', ':>', ':><', ':>=',
':\<', ':\=<', ':\==', ':\>', ':\><', ':\>=', ';', '<', '<-', '<<', '<<-',
'<|', '=', '=:=', '=<', '===', '\===', '=>', '=\=', '>', '>=', '>>', '@',
'\/', '^', '`', 'and', 'end_of_file', 'or', 'not', 'xor', 'mod', '|', '\'

% , '<<<-'   Obsolete % RM: Feb 24 1993 

)?

public('\+','$==','$=<') ?    %% BD June 10 1993


% Operator declarations.
% Insofar as possible, these correspond with ISO standard Prolog.

% Declarations of sorts, functions, and predicates.
c_op(1200,xfx,:-)?
c_op(1200,xfx,->)?
c_op(1200,xfx,<|)?
c_op(1200,fx,::)?
c_op(1200,xfx,:=)?

% Control flow inside of predicates.
c_op(1150,xfx,|)?
c_op(1100,xfy,;)? 
c_op(900,fy,'\+')?

% Unification predicate and lookalikes.
c_op(700,xfx,<-)?
c_op(700,xfx,<<-)?

% Functions.
% All expressions have precedence < 700.
% PVR 24.2.94: changed according to Bruno's suggestion
c_op(675,yfx,or)?
c_op(675,yfx,xor)? % PVR 10.2.94
c_op(650,yfx,and)? 
c_op(625,fy,not)? % PVR 10.2.94

c_op(600,xfx,===)?
c_op(600,xfx,\===)?

% Arithmetic comparisons 
c_op(600,xfx,<)?
c_op(600,xfx,>)?
c_op(600,xfx,=<)?
c_op(600,xfx,>=)?
c_op(600,xfx,=:=)?
c_op(600,xfx,=\=)?

% String comparisons
c_op(600,xfx,$<)?
c_op(600,xfx,$>)?
c_op(600,xfx,$=<)?
c_op(600,xfx,$>=)?
c_op(600,xfx,$==)?
c_op(600,xfx,$\==)?

% Sort comparisons
c_op(600,xfx,:<)?
c_op(600,xfx,:>)?
c_op(600,xfx,:=<)?
c_op(600,xfx,:>=)?
c_op(600,xfx,:==)?
c_op(600,xfx,:><)?
c_op(600,xfx,:\<)?
c_op(600,xfx,:\>)?
c_op(600,xfx,:\=<)?
c_op(600,xfx,:\>=)?
c_op(600,xfx,:\==)?
c_op(600,xfx,:\><)?

% Arithmetic operations
c_op(500,yfx,+)?
c_op(500,yfx,-)?
c_op(500,yfx,/\)?
c_op(500,yfx,\/)?

c_op(400,yfx,*)?
c_op(400,yfx,//)?
c_op(400,yfx,/)?
c_op(400,yfx,>>)?
c_op(400,yfx,<<)?
c_op(400,yfx,mod)? % PVR 24.2.94
c_op(200,fy,-)? % PVR 24.2.94
c_op(200,xfy,^)?
c_op(200,fy,\)?

% Unify function and coreference tag
c_op(150,yfx,.)? % PVR 24.2.94
c_op(100,xfy,&)?   % RM: Feb  1 1993  % PVR 24.2.94
c_op(75,fy,`)?  % RM: Feb  1 1993 % PVR 24.2.94
c_op(50,xfy,:)? % PVR 24.2.94

%%% Old stuff:

% c_op(700,xfx,<<<-) ?  % RM: Feb  8 1993    Obsolete % RM: Feb 24 1993 
% c_op(695,fx,`)?  % Quote is loosest of the functions
% c_op(500,xfy,\)?
% c_op(500,fx,+)? PVR 24.2.94
% c_op(500,fx,-)? PVR 24.2.94

% Project operator
% c_op(400,yfx,##)?   % RM: Jan  7 1993

%% c_op(300,yfx,mod)? BD June 10 1993

% Module operator
% c_op(130,xfy,#)?   % RM: Jan  7 1993 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% B U I L T _ I N 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

built_ins#set_module("built_ins")?

open_module("syntax")? % This module contains symbols init. in built_ins.c
% open_module("x")?

%% BD June 11 1993
global(tools_dir<-"~/life_local/Tools/") ?

global(examples_dir<-"~/life_local/Examples/") ?
global(superlint_dir<-"~/life_local/Examples/SuperLint/") ?
global(demo_dir<-"~/life_local/Demo/") ? %% MJV January 16 1996
global(lib_dir<-"~/life_local/Lib/") ?

simple_load("~/life_local/Source/built_ins.lf") ?       %% Copyright 1991 Digital Equipment Corporation.
% All Rights Reserved.
%
% The BUILT_IN module
%
% This file should not be modified by the user.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	$Id built_ins.lf.in,v 1.2 1996/01/17 00 vorbeck Exp $	

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Declarations
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% public built_ins

public(trace_input, query, declaration, error, abort, aborthook,abs, append,
       apply, asc, assert, asserta, bagof, beep, begin_raw, bool,
       bool_pred,bi_load_path, call_once,
       call_handler, ceiling, children, chr, clause,
       close, cond, cons, copy_pointer, copy_rules, copy_term, cos, cpu_time,
       current_module, delay_check, disj, display_module_status,
       display_modules, dynamic, end_raw, eval, evalin, exists_file,
       exists_choice, exp, fail, false, features, floor, fx, fy, gc, genint,
       get, get_choice, get_raw, glb, halt, has_feature, implies, in_raw,
       inherited_modules, init, initrandom, input_file, int, int2str,
       is_function, is_number, is_predicate, is_sort, is_value, least_sorts,
       length,life_ext, list, listing, load, load_module,
       load_path,load_suffixes, loaded_file, local_time, log, lub, map, maprel,
       max, maxint, member, min, module, mresiduate, nil, nl, nl_err,
       non_strict, nonvar, op, open, open_in, open_modules, open_out, ops,
       % not, PVR 10.2.94
       page_width, parents, parse, pause, pretty_write, pretty_writeq,
       print_codes, print_depth, print_variables, private, project,
       psi2str, public, put, put_err, put_raw, random, read, read_token, real,
       real_time, reduce, repeat, reset_window_flag, residuate, retract, rlist,
       root_sort, run, set_choice, set_input, set_output, setq, simple_load,
       sin, sqrt, static, statistics, step, str, str2psi, strcon, string,
       strip, strlen, strval, subsort, substr, succeed,system, tan,
       time, tprove, trace, true, undo, var, verbose, window_flag,
       write, write_canonical, write_err, writeq, writeq_err, import,
       % xor, PVR 10.2.94
       substitute,is_persistent, global, persistent, display_persistent, alias,
       bestof, % RM Apr 15 1993
       private_feature, % RM Mar 11 1993
       split_double, 	% RM Jun 29 1993
       string_address,	% RM Jul 6 1993
       deref_length, 	% RM Jul 15 1993
       argv,         	% RM Sep 20 1993  PVR 11.2.94
       public_symbols,	% RM Jan 28 1994
       chdir, 		% RM Feb 10 1994
       getenv, 		% RM Feb 10 1994
       module_name,	% RM Feb 16 1994
       combined_name,	% RM Feb 16 1994
       quiet,           % BD Feb 17 1994
       feature_values)?

%%% These are considered private
%%% '*** ERROR ***', '<NULL PSI TERM>',
%%% bottom,comment,constant,variable,init

private(c_op)? % RM Feb 24 1993


%%% Operators

% c_op(300,yfx,mod)? PVR 24.2.94


%%% Built-in sorts.

cons <| list.
nil <| list.
list <| built_in.

string <| built_in.

real <| built_in.
int <| real.

bool <| built_in.
true <| bool.
false <| bool.

%%% non strict declarations

non_strict(non_strict)?
non_strict(dynamic)?
non_strict(static)?
non_strict(delay_check)?
non_strict(listing)?
non_strict(evalin)?
non_strict(eval)?
non_strict(global) ?           %% BD 3.3.94
non_strict(persistent) ?       %% BD 3.3.94

%%% SYSTEM MODULE

built_ins#set_module("sys")?
built_ins#open_module("syntax")?

built_ins#public
	(bitvector,regexp,stream,file_stream,socket_stream,
	 make_bitvector,bitvector_and,bitvector_or,bitvector_xor,
	 bitvector_not,bitvector_count,bitvector_get,bitvector_set,
	 bitvector_clear,
	 regexp_compile,regexp_execute,
	 fopen,fclose,get_buffer,get_record,get_code,ftell,fseek,
	 socket,bind,connect,fwrite,fflush,listen,accept,
	 errno,errmsg,
	 import_symbol,
	 process_no_children,process_exited,process_signaled,
	 process_stopped,process_continued,
	 fork,wait,waitpid,kill,int2stream,stdin,stdout,stderr,
	 cuserid,gethostname,lazy_project,wait_on_feature,my_wait_on_feature,
	 apply1,getpid,ftruncate,stream2sys_stream,sys_stream2stream
%	 @DBM_LF@
)?

% built_ins#non_strict(wait_on_feature)?

bytedata  <| built_ins#built_in. % DENYS BYTEDATA
bitvector <| bytedata.
regexp    <| bytedata.
stream    <| bytedata.
file_stream   <| stream.
socket_stream <| stream.

built_ins#global(stdin  <- int2stream(0,"r")&file_stream)?
built_ins#global(stdout <- int2stream(1,"w")&file_stream)?
built_ins#global(stderr <- int2stream(2,"w")&file_stream)?

built_ins#persistent(string_out)?
string_out <<-
	S
				      (built_ins#psi2str(getpid)),"w+")
