LOGIC_CODES Logic Codes
(last modified on 9 November 2002)

Contents

  • logic_test_panel.stl: This file contains a program which is exploited to test the whole verifier. It relies on the following packages:

    • string_utility_pak,
    • parser,
    • sort_pak,
    • logic_syntax_analysis_pak: logic packages
    • logic_syntax_analysis_pak2: contains test_monotone_inference
    • logic_parser_aux,
    • logic_parser_globals,
    • resolution;
    • tkw,
    • map_slider: graphics package and auxiliary map slider
    • verifier_top_level: use the top level of the logic verifier collection

  • logic_main_architecture.stl: This file contains a package named

    • verifier_top_level: top level routines of logic verifier
    along with a driver for testing some of the procedures exported by this package, which are (listed alphabetically):

    • check_elem_and_discharge(strt,stp): check elem and discharge inferences in given range
    • check_tsubst_inferences(start_point,end_point): check the theorem substitution inferences in the indicated range
    • collect_fun_and_pred_arity(node,dno): collect the arity of functions and predicates (main entry)
    • find_defined_symbols(): extracts the sequence of definitions, theorems, and theories from a scenario file
    • parse_Defs_w_proofs(): parse the Defs_w_proofs file, producing all the files used subsequently

    Additional procedures in this package, not exported, are (listed alphabetically):

    • check_apply_syntax(text_of_apply): special processing for definitions by "APPLY"
    • check_discharge(statement_stack,prior_suppose_m1,stat_in_discharge,discharge_stat_no): checks a discharge operation
    • check_discharge_inferences(start_point,end_point): check the discharge inferences in the indicated range
    • check_elem_proof(proofno): read a given proof and check its ELEM conclusions
    • check_theorem_map(): check the syntax of all the theorems written to the theorem_map_file
    • collect_fun_and_pred_arity_in(node,bound_vars): collect the arity of functions and predicates (workhorse)
    • conjoin_last_neg(stat_tup): invert the last element of a collection of clauses and rewrite using 'ands'
    • conjoin_last_neg_nosemi(stat_tup): invert the last element of a collection of clauses and rewrite using 'ands'
    • definition_text(sect_no): gets stripped text of definition
    • digest_proof_lines(proof_sect_num): finds location of ==> in string, if any; position of last character is returned
    • drop_labels(stg): finds location of Statnnn: in string, if any. These labels are dropped, and positions of first characters are returned
    • drop_locdef(stg): drop "Loc_def:" if it appears
    • front_label(stg): finds prefixed Statnnn: in string, if any and returns it; otherwise returns an empty string
    • get_hints(proofno1,proofno2): read the hints which occur in a given proof
    • loc_break(stg): finds location of ==> in string, if any; position of last character is returned
    • miscellaneous_tests(stg): repository for miscellaneous top-level logic verifier tests under develoment
    • parze_expr(stg): preliminary printing/diagnosing parse
    • parse_file(lines_tup): extracts the sequence of definitions, theorems, proofs, and theories from a scenario file
    • split_at_bare_commas(stg): splits a string at commas not included in brackets
    • take_section(now_in,current_section): collects section
    • theorem_text(sect_no): gets stripped text of theorem
    • view_theorem_citations(proofno1,proofno2): count the number of theorem citations in a given range, and print them

    The packages on which the said package verifier_top_level relies are:

    • string_utility_pak
    • get_lines_pak
    • parser
    • logic_syntax_analysis_pak
    • sort_pak
    • logic_parser_globals: need access to parser global flags, etc.

  • logic_ELEM_collection.stl: This file contains packages named

    • logic_parser_aux: auxiliary routines for logic basic routines
    • logic_parser_globals: global variables for logic parser and other basic packages
    • logic_syntax_analysis_pak: syntax_analysis routines for logic system
    along with a driver for testing some of the procedures exported by these packages. No procedure is exported by logic_parser_globals; the following procedures are exported by logic_parser_aux:

    • build_model(membs_inv,givn_vars,sorted_membs): build a model for a saturated set of memberships
    • set_rep(n): returns the set representation of an integer (memoized using globals)
    and the following procedures (listed alphabetically) are exported by logic_syntax_analysis_pak:

    • algebra(formula,context): handles elementary algebraic deduction
    • algebra_blob(formula,obj_op_tup): blobs an algebraic formula to a specified theory. Returns [blobbed_formula,blobs_map]
    • blob_to_monotone(tree): modified blobbing operation which determines the monotonicity condition of each free variable (main entry)
    • blob_to_monotone_in(node,bound_vars): modified blobbing operation which determines the monotonicity condition of each free variable (workhorse)
    • blob_to_string(node,bound_vars,name_ctr): blobs a tree down to a string (main subroutine for blob_tree_in)
    • blob_tree(tree): blobs a tree down to MLSS (other versions will also be needed); top entry
    • blob_tree_in(node): blobs a tree down to MLSS (other versions will also be needed); recursive workhorse
    • blobstring_tests(): direct test of blobstring operation
    • boil_down_blobbed(tree): performs simplify_builtins, simplify_onces, exploit_prop_sign in order
    • build_model(membs_inv,givn_vars,sorted_membs): build a model for a saturated set of memberships
    • build_quantified_version(formula,bnd_vars_with_ranges): add appropriate quantifiers to a formula
    • check_member(blob_tree,alg_objects_set,context)
    • check_zero_value(stand_poly_tree,all_vars): checks standardized polynomial tree for identically zero value
    • clean_tree(parse_tree): simplifies the parse_tree; returns tree
    • cleanup(parse_tree): simplifies the parse_tree; returns string
    • common_iter_len(list_of_iters_1,list_of_iters_2,body_1,body_2): find the iterator portions which are of the same types
    • Davis_Putnam(clause_set,term_decider,td_prms): extended Davis-Putnam procedure for verifying propositional consistency.
    • decompose_post_blobbing(formula): decomposition procedure for formulae blobbed o a decidable language
    • degree_poly(poly_tree): crude estimate of the degree if a standardized polynomial tree
    • drop_monotone(ops): drop the monotonicity property of one or more function symbols
    • drop_parens(stg): drop some unnecessary parens
    • dump_in(parse_tree,indent): recursive workhorse for dump
    • dump_tree(parse_tree): dumps the parse_tree in indented format
    • enable_algebra(operator_list,context): enables elementary algebraic deduction for elements of a set and operators on it
    • evaluate_poly(poly_tree,var_val_map): recursive evaluation of a standardized polynomial tree
    • end_prant(): terminates compressing print sequence
    • find_all_vars(node): find all the variables in a formula
    • find_bound_vars(node): find the bound variables at the top of an iterator tree
    • find_bound_vars_test(): test the 'find_bound_vars' operation, for setformer and iteration nodes
    • find_free_vars(node): find the free variables in a tree (main entry)
    • find_free_vars_from(node,bound_vars): find the free variables in a tree (alternative main entry, used by blob_to_monotone)
    • find_free_vars_in(node,bound_vars): find the free variables in a tree (recursive workhorse)
    • find_iterators(node): find the iterator list at the top of an iterator tree
    • find_repmap(equalities): find repmap for a set of equalities
    • flatten_existential(node): get the chain of all existential quantifiers starting at a given node a first existential appears
    • flatten_same_ops(node): get the chain of all identical infix operations starting at a given node at which this operation appears
    • flatten_universal(node): get the chain of universal quantifiers starting at a given node a first universal appears
    • gen_name(rw name_ctr): generate a new blob name
    • get_blob(stg): once a tree has been blobbed to a structured string, this routine looks it up in the collection of all such strings, to determine its blob number
    • handle_quant_clause(tree1,tree2): finds the substitution, if any, that generates formula 2 from formula 1
    • init_logic_syntax_analysis(): initialize for logic syntax-tree operations
    • make_clause(vars_and_ranges,clause): creates a quantified equivalence/equality clause prefixed by a given set of quantifiers
    • mlss_decider(truth_value,td_params): tableau-based term decider for mlss
    • model_blobbed(formula): models a blobbed mlss formula, or pronounces it unsatisfiable by returning OM
    • new_name(stg,nameset): generates new names for bound variables during a simplification operation
    • parze_expr(stg): print source; then parse
    • post_monotone(op_and_arg_string): note the monotonicity property of one or more function symbols
    • prant(stg): auxiliary compressing print
    • reduce_by_repmap(items,repmap): reduce a set of tuples using a repmap
    • show_map(map): print of variable-to_expression map provided by 'verify_instance'
    • simplify_setformer(tree,iterator_indices): removes specified membership iterators over setformer expressions
    • small_mlss_test(): initial explicit test of mlss decider
    • standardize_bound_vars(formula): standardize the bound variable names in a formula
    • standardize_bound_vars_noad(formula): standardize the bound variable names in a formula, restarting bound variable names counter
    • standardize_formula(poly_tree,op_obj_tup): standardizes a polynomial tree belonging to a specified algebraic theory
    • substitute(tree,substitution_map): makes substitutions for specified free variables of a formula. (main entry; uses workhorse)
    • substitute_in(tree,substitution_map,bound_vars): inner recursive workhorse of substitution routine
    • substitution_test(): substitution test
    • test_algebra(): inital tests of ALGEBRA deduction
    • test_basic_parses(): view parse trees of basic constructions
    • test_blob_to_monotone(): test the blob_to_monotone routine
    • test_blob_to_string(): tests of blob_to_string function
    • test_blobbing(): test the blob_tree function
    • test_boil_down_blobbed(): test overall simplification of blobbed expression
    • test_bool_exp(stg,fcn): check agreement of davis_putnam and truth-table for 4-variable boolean expressions
    • test_build_quantified(): test of 'build_quantified_version' routine
    • test_count_free_vars(): test of count_free_vars routine
    • test_Davis_Putnam(): test the Davis_Putnam propositional decision algorithm
    • test_equality_inference(): inital tests of equality inferencing
    • test_equality_more(): supplemental equality tests
    • test_exploit_prop_signs(): test of search routine exploiting propositional variables of one sign
    • test_find_diffs(): test of 'find_diffs' procedure
    • test_find_prop_signs(): test of search routine for propositional variables of one sign
    • test_mls(): Eugenio's collection of MLS tests
    • test_model_blobbed(): inital tests and timing of the mlss verifier
    • test_simplify_builtins(): test of special simplifications for builtin operators
    • test_simplify_onces(): test of special simplifications for variables appearing once
    • test_simplify_setformer(): test the simplify_setformer routine
    • test_top_sort_stgs(): test the top_sort_stgs function
    • test_verify_instance(): inital tests of 'verify_instance' procedure
    • timing_tests(): a few tests of MLSS timing
    • top_sort_stgs(G): topological sorting procedure. G is a dependency graph for a set of strings; used to sort iterators
    • unparse(tree): puts a tree back into string format
    • unparse_in(tree): puts a tree back into string format
    • unparse_test(): test unparse operation
    • verify_equality(tree1,tree2,context,is_pred): verifies equality or equivalence of two formulae (main entry)
    • verify_equality_in(tree1,tree2,bound_vars_with_ranges,context,is_pred): verifies equality or equivalence of two formulae (workhorse)
    • verify_instance(tree1,tree2): finds the substitution, if any, that generates formula 2 from formula 1 (main entry)
    • verify_instance_in(tree1,tree2,inv,inuni,frozen): finds the substitution, if any, that generates formula 2 from formula 1 (workhorse)

    Additional procedures in the package logic_syntax_analysis_pak, not exported, are (listed alphabetically):

    • add_memb(x,y): respond to the appearance of a new membership relation 'x in y'
    • add_nonmemb(x,y): respond to the appearance of a new nonmembership relation 'x notin y'
    • algebra_blob_in(formula): recursive workhorse for algebra bolobbing; builds blobbed_formula and global algebra_blobs_map
    • algebra_get_blob(stg): once a tree has been blobbd to a structured string, this routine looks it up in the collection of all such strings,
    • atom_stg(x): converts atom to string
    • atom_with_meaning(tup): find or form an atom with the specified meaning
    • atom_with_set_meaning(tup): find or for an atom with the specified set-value meaning
    • atom_with_sp_set_meaning(tup): find or for an atom with the specified set-value meaning
    • blob_and_check(a1,a2,op_obj_tup,context): perform blob_and_check test in specified theory
    • check_definition(tree,symbols): check a recursive or nonrecursive definition for validity
    • check_in_context(formula,bnd_vars_with_ranges,context)
    • check_match_to_vars(tree1,tree2,frozen): check identity of strings after matching of free vars (main entry)
    • check_match_to_vars_in(tree1,tree2,bound_vars): check identity of strings after matching of free vars (workhorse)
    • check_pred_definition(tree,statement,symbols): checks skolem-type definition for validity
    • count_free_vars(node): find and count the free variables in a tree (main entry)
    • count_free_vars_in(node,bound_vars,parent_context): find and count the free variables in a tree (recursive workhorse)
    • decompose_in(formula,is_prop): recursive inner workhorse for formula decomposition
    • deduce_from_neg_memb(x,y): make all deductions from a positive membership relation 'x notin y'
    • deduce_from_pos_memb(x,y): make all deductions from a positive membership relation 'x in y'
    • defmemb(tree1,tree2,substitution_map): check validity of a defmemb deduction involving a quantified statement or a set membership relation
    • DP_biased_pos(term,unsatisfied_clauses,singles,one_sign,undefined_terms,num_undefined_terms,clauses_with_term_pos,clauses_with_term_neg,truth_value): this 'recursion header' routine exists only to ease recovery from the changes it makes, if it fails
    • DP_in(unsatisfied_clauses,singles,one_sign,undefined_terms,num_undefined_terms,clauses_with_term_pos,clauses_with_term_neg,truth_value): inner workhorse of the Davis-Putnam procedure, this procedure returns a satisfying model, if any can be found; otherwise OM
    • evaluate_poly_in(poly_tree): recursive evaluation of a standardized polynomial tree
    • exploit_prop_signs(node): use the signs of propositional variables to simplify (main entry)
    • exploit_prop_signs_in(node): use the signs of propositional variables to simplify (workhorse)
    • find_mlss_model(op_app_0,op_app_1,op_app_2,only_membr,pos_membrs,neg_membrs,pos_membrs_inv,neg_membrs_inv,unprocessed_membrs,incs_apps_1,incs_apps_2,unres_alts,singletns): find a model of a predigestd set of mlss clauses
    • find_mlss_model_with_new(new_pos_cl,new_neg_cl,op_app_0,op_app_1,op_app_2,only_membr,pos_membrs,neg_membrs,pos_membrs_inv,neg_membrs_inv,unprocessed_membrs,incs_apps_1,incs_apps_2,unres_alts,singletns): variant of find_mlss_model; processes 1 or 2 new clauses at very start
    • find_prop_signs(node): find the signs of propositional variables if these are definite (main entry)
    • find_prop_signs_in(node,psgn): find the signs of propositional variables if these are definite (recursive workhorse)
    • looky(x): for debugging
    • lpa(): conditional left parenthesis
    • match_to(tree1,tree2): tree matching algorithm, biases toward sustitutions in tree1 (main entry)
    • match_to_in(tree1,tree2,bound_vars): tree matching algorithm, biases toward substitutions in tree1 (workhorse)
    • maytrace(n): debugging auxiliary
    • next_vect(v,limit): increments a vector of integers, up to the final vector [limiit,limit,...]
    • newblob(stg):
    • num_exact_iter_matches(iters1,iters2,inuni,frozen): find the number of exact matches in two iterator sequences (existential case)
    • range_blob(node): this blobs a set expressions and quantifiers down functions involving basic set-theretic operators
    • reverse_context(parent_context): reverses = to /=, in to notin. Returns OM otherwise
    • remove_clause(clause,rw unsatisfied_clauses,rw clauses_with_term_pos,rw clauses_with_term_neg,rw one_sign): used to remove a clause which has been satisfied
    • replace_symbols(stg,replacement_map): replace specified letters by corresponding range elements
    • rpa(): conditional right parenthesis
    • simplify_builtins(tree): simplifies various expressions involving built-in operators
    • simplify_builtins_in(tree): workhorse: simplifies various expressions
    • simplify_onces(tree): equisatisfiability simplification for variables occurring only once
    • simplify_onces_in(tree): equisatisfiability workhorse for variables occurring only once
    • special_bigger_op(bigop,op): special processing for pair of monotone operators in known inclusion relationship
    • special_equiv_reln(reln): special processing for equivalence relationships
    • special_idempotent(op): special processing for idempotent functions
    • special_inher_add(pred): special processing for inherited-additive predicates
    • special_mon(op): special processing for monotone operator
    • special_mon2(op): special processing for monotone operator with 2 arguments
    • special_mondn(op): special processing for monotone decreasing operator
    • special_part_order(reln): special processing for partial-order relationships
    • special_self_inverse(op): special processing for self_inverse functions
    • special_tot_order(reln): special processing for total-order relationships
    • standardize_bound_vars_adv(formula): standardize the bound variable names in a formula, restarting bound variable names counter
    • standardize_bound_vars_in(tree,std_bv_names): standardize the bound variable names in a formula
    • standardize_bound_vars_adv(formula): standardize the bound variable names in a formula, restarting bound variable names counter
    • standardize_bound_vars_in(tree,std_bv_names): standardize the bound variable names in a formula
    • standardize_formula_in(poly_tree): recursive workhorse
    • strip_and_match(tree1,tree2,num_quants,num_conj,quant_list)
    • top_sort(G): 'plain' topological sorting procedure, done crudely
    • unparse_in(tree): puts a tree back into string format

    The packages on which the said package logic_parser_aux relies are:

    • logic_parser_globals

    The packages on which the said package logic_syntax_analysis_pak relies are:

    • string_utility_pak
    • parser
    • sort_pak
    • logic_parser_globals: global variables for logic parser and other basic packages
    • logic_parser_aux: auxiliary routines for logic basic routines

    The packages on which the test program relies are:

    • string_utility_pak
    • parser
    • sort_pak
    • logic_syntax_analysis_pak
    • logic_parser_aux
    • logic_parser_globals

  • logic_ELEM_supplement.stl: This file contains a package named

    • logic_syntax_analysis_pak2: second part of logic_syntax_analysis_pak
    along with a driver for testing some of the procedures exported by this package, which are (listed alphabetically):

    • dequantify(tree,substitution_tup): makes substitutions for specified quantified variables of a formula (main entry; uses workhorse)
    • find_fnc_symbs(node): find the function symbols in a tree
    • test_dequantify(): test of the dequantify procedure
    • test_find_fnc_symbs(): test of the find_fnc_symbs procedure
    • test_monotone_inference(): test of the find_fnc_symbs procedure

    Additional procedures in this package, not exported, are (listed alphabetically):

    • conjoin(clauses): conjoin a collection of clauses
    • dequantify_in(tree,substitution_tup,substitution_map,bool_sign,bound_vars_not_replaced)
    • dequantify_in_trace(tree,substitution_tup,substitution_map,bool_sign,bound_vars_not_replaced): inner recursive workhorse of substitution routine
    • find_fnc_symbs(node): find the function symbols in a tree (main entry)
    • find_fnc_symbs_in(node): find the function symbols in a tree (recursive workhorse)
    • monotone_inference(node1,node2): calculates conditions for value defined by node 1 to include value defined by node 2
    • monotone_inference_in(tree1,tree2,bound_vars_with_ranges,is_pred): workhorse for 'monotone_inference'

    The packages on which the said package logic_syntax_analysis_pak2 relies are:

    • string_utility_pak
    • parser
    • sort_pak
    • logic_parser_globals: global variables for logic parser and other basic packages
    • logic_parser_aux: auxiliary routines for logic basic routines
    • logic_syntax_analysis_pak: use the first package

  • logic_resolution_test.stl: This file contains a package named

    • resolution: experimental resolution routine as described in book
    along with a driver for resolution testing.

    The packages on which the said package resolution relies are:

    • string_utility_pak
    • get_lines_pak
    • parser
    • logic_syntax_analysis_pak
    • sort_pak
    • logic_parser_globals

    Its procedures, of which only resolution_test is exported, are (listed alphabetically):

    • apply_substs(atm,subst_map): apply a substitution map to a specified atom
    • attach_vars(atm): attach variables to an atomic formula
    • clean_tree(t): recursive tree-cleaner; calculates descendant variables
    • clean_tree_in(t): recursive tree-cleaner; calculates descendant variables (workhorse)
    • do_subst(atm,substs): apply indicated substitutions to unit formula and return result
    • freshclean_tree(t): recursive tree-cleaner; freshens and cleans descendant variables
    • freshen_atom(t): recursive freshener for atomic formulae; also supplies descendant variables
    • freshen_atom_in(t): recursive freshener for atomic formulae; also supplies descendant variables
    • freshen_in(t): recursive tree-cleaner; calculates descendant variables (workhorse)
    • freshen_var(v): freshen a variable in the manner described by the comment in 'freshen_atom'
    • get_reps(idents): convert a set of identities to a mapping-to-representative
    • Horn_resolve(inputs,goals,mults,input_limit): main procedure for Horn resolution
    • make_mult_tuple(mult): this converts a multiplication rule from its standard format involving 'or' and 'not'
    • next_jump(n): move the last (least significant) component of the iter component forward to n
    • next_tuple(): iteration over tuples in specified range
    • printt(tup): tuple-printer
    • recover_proof(source_of_formula,inputs,mults): this converts a multiplication rule from its standard format involving 'or' and 'not'
    • reduce_by_reps(t,reps): reduce a term using a representative mapping
    • resolution_test(example_name,allow_intermediates): run specified resolution test, allowing specified number of intermediates
    • standardize_atom(t): standardize an atomic formula; the input to this must be an already freshened tree
    • standardize_atom_in(t): standardize an atomic formula; the input to this must be an already freshened tree
    • start_tuple(tup): start iteration over tuples in specified range
    • top_sort(G): optimized iterative form of the topological sorting procedure
    • try_multiply(inps,mult): attempt to multiply list of unit formulae using multiplication rule
    • unify(t1,t2): unification test routine
    • unify_all(as,bs): attempt to unify lists of unit formulae, and return resulting substitutions, or OM
    • unparse_atom(atm): unparse a predicate atom
    • unparse_stand(atm): unparse a standardized atom
    • unify_in_toplev(t1,t2): unification test routine (top level of workhorse)
    • unify_in(t1,t2): unification test routine (workhorse)

  • logic_verifier_proof_runs.txt: This file keeps a record of experiments carried out with the logic verifier

  • ----------------------

  • External packages referred to by the packages in this directory:

    • get_lines_pak
    • map_slider: map slider auxiliary to the graphics package tkw
    • sort_pak
    • string_utility_pak
    • tkw: graphics package

  • FILE CATALOG


Address

Eugenio Omodeo - Dipartimento di Informatica
Università di L'Aquila
Via Vetoio Loc. Coppito
I-67010 L'Aquila

phone: +39 0862 433126
fax: +39 0862 433180

email:omodeo@di.univaq.it