C:/Users/Dennis/src/lang/Life_start/Life/life-1.02/source/types.c File Reference

#include "extern.h"
#include "login.h"
#include "trees.h"
#include "print.h"
#include "memory.h"
#include "error.h"
#include "token.h"

Go to the source code of this file.

Data Structures

struct  wl_pair_def

Typedefs

typedef struct wl_pair_def pair_def

Functions

void make_type_link ()
void print_def_type (def_type t)
long yes_or_no ()
 remove_cycles (ptr_definition d, ptr_int_list *dl)
long redefine (ptr_psi_term t)
ptr_int_list cons (GENERIC v, ptr_int_list l)
long assert_less (ptr_psi_term t1, ptr_psi_term t2)
void assert_protected (ptr_node n, long prot)
void assert_args_not_eval (ptr_node n)
void assert_delay_check (ptr_node n)
void clear_already_loaded (ptr_node n)
void assert_type (ptr_psi_term t)
void assert_complicated_type (ptr_psi_term t)
void assert_attributes (ptr_psi_term t)
void find_adults ()
void insert_own_prop (ptr_definition d)
void insert_prop (ptr_definition d, ptr_triple_list prop)
void propagate_definitions ()
long count_sorts (long c0)
void clear_coding ()
void least_sorts ()
void all_sorts ()
ptr_int_list two_to_the (long p)
ptr_int_list copyTypeCode (ptr_int_list u)
void or_codes (ptr_int_list u, ptr_int_list v)
 equalize_codes (int len)
long type_member ()
void make_type_link (ptr_definition t1, ptr_definition t2)
long type_member (ptr_definition t, ptr_int_list tlst)
void perr_sort (ptr_definition d)
void perr_sort_list (ptr_int_list anc)
void perr_sort_cycle (ptr_int_list anc)
long type_cyclicity (ptr_definition d, ptr_int_list anc)
void propagate_always_check (ptr_definition d, long *ch)
void one_pass_always_check (long *ch)
void inherit_always_check ()
void encode_types ()
void print_codes ()
long sub_CodeType ()
long glb_value (long result, long f, GENERIC c, GENERIC value1, GENERIC value2, GENERIC *value)
long glb_code (long f1, GENERIC c1, long f2, GENERIC c2, long *f3, GENERIC *c3)
long glb (ptr_definition t1, ptr_definition t2, ptr_definition *t3, ptr_int_list *c3)
long overlap_type (ptr_definition t1, ptr_definition t2)
long sub_CodeType (ptr_int_list c1, ptr_int_list c2)
long sub_type (ptr_definition t1, ptr_definition t2)
long matches (ptr_definition t1, ptr_definition t2, long *smaller)
long strict_matches (ptr_psi_term t1, ptr_psi_term t2, long *smaller)
long bit_length (ptr_int_list c)
ptr_int_list decode (ptr_int_list c)

Variables

static char vcid [] = "$Id: types.c,v 1.7 1994/12/15 22:28:56 duchier Exp $"
long types_modified
long type_count
ptr_definitiongamma_table
ptr_int_list adults
ptr_int_list children


Typedef Documentation

typedef struct wl_pair_def pair_def


Function Documentation

void all_sorts (  ) 

Definition at line 739 of file types.c.

References cons(), first_definition, wl_definition::next, nothing, wl_definition::parents, type, and wl_definition::type.

Referenced by encode_types().

void assert_args_not_eval ( ptr_node  n  ) 

Definition at line 296 of file types.c.

References deref_ptr, wl_definition::evaluate_args, FALSE, wl_definition::keyword, wl_keyword::symbol, type, wl_definition::type, wl_psi_term::type, and Warningline.

Referenced by c_non_strict().

void assert_attributes ( ptr_psi_term  t  ) 

Definition at line 491 of file types.c.

References add_rule(), wl_psi_term::attr_list, deref_ptr, Errorline(), function, get_two_args(), wl_definition::keyword, NULL, predicate, wl_keyword::symbol, TRUE, type, wl_definition::type, wl_psi_term::type, types_modified, and wl_const.

Referenced by assert_clause().

void assert_complicated_type ( ptr_psi_term  t  ) 

Definition at line 398 of file types.c.

References add_rule(), assert_less(), assert_ok, wl_psi_term::attr_list, deref_ptr, disjunction, equ_tok, Errorline(), FALSE, get_two_args(), wl_definition::keyword, nil, NULL, wl_keyword::symbol, TRUE, type, wl_psi_term::type, and Warningline.

Referenced by assert_clause().

void assert_delay_check ( ptr_node  n  ) 

Definition at line 326 of file types.c.

References wl_definition::always_check, deref_ptr, FALSE, and wl_psi_term::type.

Referenced by c_delay_check().

long assert_less ( ptr_psi_term  t1,
ptr_psi_term  t2 
)

Definition at line 206 of file types.c.

References deref_ptr, Errorline(), FALSE, function, wl_definition::keyword, make_type_link(), predicate, redefine(), wl_keyword::symbol, top, TRUE, type, wl_definition::type, and types_modified.

Referenced by assert_complicated_type(), and assert_type().

void assert_protected ( ptr_node  n,
long  prot 
)

Definition at line 258 of file types.c.

References wl_definition::date, deref_ptr, wl_definition::keyword, MAX_BUILT_INS, wl_definition::protected, wl_definition::rule, wl_keyword::symbol, type, wl_definition::type, wl_psi_term::type, and Warningline.

Referenced by c_dynamic(), and c_static().

void assert_type ( ptr_psi_term  t  ) 

Definition at line 368 of file types.c.

References assert_less(), assert_ok, Errorline(), get_two_args(), and NULL.

long bit_length ( ptr_int_list  c  ) 

Definition at line 1678 of file types.c.

References INT_SIZE.

Referenced by bfs(), decode(), and mark_ancestors().

void clear_already_loaded ( ptr_node  n  ) 

Definition at line 349 of file types.c.

References wl_definition::already_loaded, and FALSE.

void clear_coding (  ) 

Definition at line 708 of file types.c.

References wl_definition::code, first_definition, wl_definition::next, NOT_CODED, type, and wl_definition::type.

Referenced by encode_types().

ptr_int_list cons ( GENERIC  v,
ptr_int_list  l 
)

Definition at line 187 of file types.c.

References HEAP_ALLOC, wl_int_list::next, and wl_int_list::value.

Referenced by all_sorts(), decode(), encode_types(), least_sorts(), make_type_link(), and stack_cons().

ptr_int_list copyTypeCode ( ptr_int_list  u  ) 

Definition at line 783 of file types.c.

References HEAP_ALLOC, wl_int_list::next, NULL, or_codes(), and wl_int_list::value.

Referenced by lub().

long count_sorts ( long  c0  ) 

Definition at line 692 of file types.c.

References first_definition, wl_definition::next, type, and wl_definition::type.

Referenced by encode_types().

ptr_int_list decode ( ptr_int_list  c  ) 

Definition at line 1708 of file types.c.

References bit_length(), wl_definition::code, cons(), wl_int_list::next, NULL, STACK_ALLOC, and wl_int_list::value.

Referenced by c_glb(), and lub().

void encode_types (  ) 

Definition at line 1045 of file types.c.

References all_sorts(), built_in, wl_definition::children, clear_coding(), wl_definition::code, cons(), count_sorts(), equalize_codes(), Errorline(), FALSE, heap_alloc(), inherit_always_check(), integer, wl_definition::keyword, least_sorts(), make_sys_type_links(), make_type_link(), wl_int_list::next, NOT_CODED, nothing, NULL, or_codes(), overlap_type(), wl_definition::parents, perr(), propagate_definitions(), quoted_string, real, wl_keyword::symbol, top, Traceline, TRUE, two_to_the(), type_count, type_cyclicity(), types_done, types_modified, and wl_int_list::value.

Referenced by c_assert_first(), c_assert_last(), load_aim(), main(), WFInput(), and what_next_aim().

equalize_codes ( int  len  ) 

Definition at line 829 of file types.c.

References assert, wl_definition::code, first_definition, HEAP_ALLOC, wl_int_list::next, wl_definition::next, NULL, type, and wl_definition::type.

Referenced by encode_types().

void find_adults (  ) 

Definition at line 539 of file types.c.

References first_definition, HEAP_ALLOC, wl_int_list::next, wl_definition::next, NULL, wl_definition::parents, type, wl_definition::type, and wl_int_list::value.

Referenced by propagate_definitions().

long glb ( ptr_definition  t1,
ptr_definition  t2,
ptr_definition t3,
ptr_int_list c3 
)

Definition at line 1418 of file types.c.

References wl_definition::code, FALSE, wl_int_list::next, NOT_CODED, nothing, NULL, STACK_ALLOC, top, TRUE, and wl_int_list::value.

Referenced by c_glb(), and global_unify().

long glb_code ( long  f1,
GENERIC  c1,
long  f2,
GENERIC  c2,
long*  f3,
GENERIC c3 
)

Definition at line 1293 of file types.c.

References wl_definition::code, FALSE, wl_int_list::next, NOT_CODED, NULL, STACK_ALLOC, top, TRUE, and wl_int_list::value.

Referenced by residuateGoalOnVar().

long glb_value ( long  result,
long  f,
GENERIC  c,
GENERIC  value1,
GENERIC  value2,
GENERIC value 
)

Definition at line 1236 of file types.c.

References wl_definition::code, FALSE, NULL, quoted_string, REAL, real, sub_CodeType(), and TRUE.

Referenced by residuateGoalOnVar().

void inherit_always_check (  ) 

Definition at line 1024 of file types.c.

References FALSE, and one_pass_always_check().

Referenced by c_delay_check(), and encode_types().

void insert_own_prop ( ptr_definition  d  ) 

Definition at line 562 of file types.c.

References wl_pair_list::a, wl_pair_list::b, FALSE, HEAP_ALLOC, wl_pair_list::next, wl_int_list::next, NULL, TRUE, and wl_int_list::value.

Referenced by propagate_definitions().

void insert_prop ( ptr_definition  d,
ptr_triple_list  prop 
)

Definition at line 603 of file types.c.

References wl_triple_list::a, wl_triple_list::b, wl_triple_list::c, FALSE, HEAP_ALLOC, wl_triple_list::next, wl_definition::next, wl_int_list::next, NULL, TRUE, and wl_int_list::value.

Referenced by propagate_definitions().

void least_sorts (  ) 

Definition at line 723 of file types.c.

References wl_definition::children, cons(), first_definition, wl_definition::next, nothing, NULL, wl_definition::parents, type, and wl_definition::type.

Referenced by encode_types().

void make_type_link ( ptr_definition  t1,
ptr_definition  t2 
)

Definition at line 871 of file types.c.

References cons(), top, and type_member().

void make_type_link (  ) 

Referenced by assert_less(), encode_types(), and make_sys_type_links().

long matches ( ptr_definition  t1,
ptr_definition  t2,
long *  smaller 
)

Definition at line 1595 of file types.c.

References wl_definition::code, FALSE, wl_int_list::next, NOT_CODED, top, TRUE, and wl_int_list::value.

Referenced by c_ascii(), c_boolpred(), c_chdir(), c_logical_main(), c_not(), c_parse(), c_string_address(), c_xor(), check_real(), fetch_def_lazy(), get_bool_value(), get_real_value(), isa(), match_aim(), strict_matches(), and unify_real_result().

void one_pass_always_check ( long *  ch  ) 

Definition at line 1006 of file types.c.

References wl_definition::always_check, first_definition, wl_definition::next, propagate_always_check(), type, and wl_definition::type.

Referenced by inherit_always_check().

void or_codes ( ptr_int_list  u,
ptr_int_list  v 
)

Definition at line 803 of file types.c.

References HEAP_ALLOC, and NULL.

Referenced by bfs(), copyTypeCode(), encode_types(), and lub().

long overlap_type ( ptr_definition  t1,
ptr_definition  t2 
)

Definition at line 1516 of file types.c.

References wl_definition::code, FALSE, wl_int_list::next, NOT_CODED, top, TRUE, and wl_int_list::value.

Referenced by c_append_file(), c_char(), c_concatenate(), c_initrandom(), c_int2string(), c_open_out(), c_random(), c_string2psi(), c_string_length(), c_sub_string(), call_primitive(), encode_types(), get_module(), global_unify(), match_aim(), and pretty_list().

void perr_sort ( ptr_definition  d  ) 

Definition at line 906 of file types.c.

References perr_s().

Referenced by perr_sort_cycle(), and perr_sort_list().

void perr_sort_cycle ( ptr_int_list  anc  ) 

Definition at line 922 of file types.c.

References perr(), perr_sort(), and perr_sort_list().

Referenced by type_cyclicity().

void perr_sort_list ( ptr_int_list  anc  ) 

Definition at line 912 of file types.c.

References perr(), and perr_sort().

Referenced by perr_sort_cycle().

void print_codes (  ) 

Definition at line 1208 of file types.c.

References outputline(), and type_count.

Referenced by c_print_codes().

void print_def_type ( def_type  t  ) 

Definition at line 45 of file types.c.

References function, global, perr(), predicate, and type.

void propagate_always_check ( ptr_definition  d,
long *  ch 
)

Definition at line 980 of file types.c.

References wl_definition::always_check, FALSE, wl_int_list::next, TRUE, and wl_int_list::value.

Referenced by one_pass_always_check().

void propagate_definitions (  ) 

Definition at line 645 of file types.c.

References wl_definition::children, find_adults(), insert_own_prop(), insert_prop(), wl_int_list::next, NULL, wl_definition::properties, and wl_int_list::value.

Referenced by encode_types().

long redefine ( ptr_psi_term  t  ) 

Definition at line 115 of file types.c.

References wl_definition::children, wl_keyword::combined_name, wl_definition::date, deref_ptr, Errorline(), FALSE, file_date, wl_definition::keyword, MAX_BUILT_INS, wl_definition::parents, wl_definition::protected, remove_cycles(), wl_definition::rule, wl_keyword::symbol, TRUE, type, wl_definition::type, undef, warningflag, Warningline, and yes_or_no().

Referenced by add_rule(), assert_less(), and pred_clause().

remove_cycles ( ptr_definition  d,
ptr_int_list dl 
)

Definition at line 97 of file types.c.

References wl_int_list::next.

Referenced by redefine().

long strict_matches ( ptr_psi_term  t1,
ptr_psi_term  t2,
long *  smaller 
)

Definition at line 1638 of file types.c.

References FALSE, matches(), NULL, TRUE, wl_psi_term::type, and wl_psi_term::value.

long sub_CodeType ( ptr_int_list  c1,
ptr_int_list  c2 
)

Definition at line 1552 of file types.c.

References FALSE, wl_int_list::next, NOT_CODED, TRUE, and wl_int_list::value.

long sub_CodeType (  ) 

Referenced by bfs(), check_resid(), glb_value(), and sub_type().

long sub_type ( ptr_definition  t1,
ptr_definition  t2 
)

Definition at line 1574 of file types.c.

References wl_definition::code, FALSE, sub_CodeType(), top, and TRUE.

Referenced by apply1_internal(), c_boolpred(), c_exist_feature(), c_is_number(), c_page_width(), c_print_depth(), c_project(), c_psi2string(), call_primitive(), check_psi_term(), declare_operator(), get_bool(), lazy_project_internal(), lub(), my_wait_on_feature_internal(), pretty_psi_term(), prove_aim(), wait_on_feature_internal(), WFGetDouble(), and WFGetString().

ptr_int_list two_to_the ( long  p  ) 

Definition at line 754 of file types.c.

References HEAP_ALLOC, INT_SIZE, wl_int_list::next, NULL, and wl_int_list::value.

Referenced by encode_types().

long type_cyclicity ( ptr_definition  d,
ptr_int_list  anc 
)

Definition at line 937 of file types.c.

References wl_definition::code, Errorline(), exit_life(), FALSE, wl_int_list::next, NOT_CODED, perr(), perr_sort_cycle(), TRUE, type_member(), and wl_int_list::value.

Referenced by encode_types().

long type_member ( ptr_definition  t,
ptr_int_list  tlst 
)

Definition at line 894 of file types.c.

References FALSE, wl_int_list::next, TRUE, and wl_int_list::value.

long type_member (  ) 

Referenced by make_type_link(), and type_cyclicity().

long yes_or_no (  ) 

Definition at line 68 of file types.c.

References EOLN, input_state, old_state, open_input_file(), perr(), prompt, read_char(), and restore_state().

Referenced by redefine().


Variable Documentation

ptr_int_list adults

Definition at line 30 of file types.c.

ptr_int_list children

Definition at line 30 of file types.c.

ptr_definition* gamma_table

Definition at line 28 of file types.c.

Referenced by check_gamma_code(), and check_gamma_rest().

long type_count

Definition at line 26 of file types.c.

Referenced by c_print_codes(), check_gamma_code(), check_gamma_rest(), encode_types(), lub(), and print_codes().

long types_modified

Definition at line 25 of file types.c.

Referenced by assert_attributes(), assert_less(), and encode_types().

char vcid[] = "$Id: types.c,v 1.7 1994/12/15 22:28:56 duchier Exp $" [static]

Definition at line 7 of file types.c.


Generated on Sat Jan 26 08:48:09 2008 for WildLife by  doxygen 1.5.4