Changes by: Aleksey Nogin (nogin at cs.caltech.edu)
Date: 2003-07-31 13:38:00 -0700 (Thu, 31 Jul 2003)
Revision: 4797
Log message:

      ***                WARNING                   ***
      *** This check-in breaks .prlb compatibility ***
      *** Export any unsaved proofs to .prla       ***
      *** before running "cvs update"              ***
      
      This is a major change in the way meta-variables work. This commit is supposed
      to finally bring the implementation of the rewriter into full argeement with
      the on-paper semantics of the sequent schema language and make our implementation
      fully valid.
      
      This commit makes sequent contexts binding occurrences and makes all meta-variables
      (bot SO variables and sequent contexts) explicitly list all the contexts that can
      introduce variables that can occur freely in whatever the meta-variable can match.
      For example, f<||>[] can only match closed terms, f<|H|>[] can only match terms whose
      only free variables (more specifically - free first-order and context variables) are
      those introduced by H.
      
      To avoid having to specify contexts explicitly all the time, the following conventions
      are observed:
      - in a term (on I/O), the maximal possible contexts are presumed. E.g.
      sequent{ <H>; x: A; <J['x]> >- C['x] } is now a shortcut for
      sequent{ <H<||>>; x: A<|H|>; <J<|H|>['x]> >- C<|J;H|>['x] }
      - in a rule (input only), the terms are scanned top-to-bottom (e.g. conclusion,
      then assumptions from last to first, then rule arguments, then whatever terms
      are mentioned in resource annotations) and the first time each meta-variable occurs,
      its contexts are remembered and copied over all other places where it is used without
      contexts being explicitly specified.
      For example,
      sequent { <H>; <J> >- A } --> sequent { <H>; A; <J> >- C }
      will get parsed as ... A <|H|> ... A<|H|> ...
      but
      sequent { <H>; A; <J> >- C } sequent { <H>; <J> >- A }
      will get parsed as ... A <|J;H|> ... A<|J;H|> ...
      (as will cause the rule to be rejected by the rewriter since the first sequent
      now has a free occurrence of H).
      - in a top-loop variables in terms are expanded according to the rule being proven.
      for example, if a rule has a s-o variable "v<|H;J|>" in it, then when inside such
      a rule, <<'v>> will get parsed as << 'v<|H;J|> >> (and it will get parsed as
      a f-o variable v in other rules, where v is not used as a s-o variable). Note
      that << lambda{v.'v} >> will still get parsed as << lambda{v.'v} >> (e.g. with v
      being a f-o variable), not as << lambda{v. 'v<|H;J|> } >>!
      
      This commit also creates a distinction between 0-arity second-order variables and
      free first-order variables. For now (to keep some of the old code happy), the
      first-oder variables are considered a special case of second-order variables, but
      this will (hopefully) soon go away.
      
      Currently, the free variable computations in TermSubsts return the union of all 3
      kinds of variables in a term - free context variables, free f-o variables and all
      s-o variables. This is not necessarily the best choice from the semantic standpoint,
      but it make the implementation easier. Note that an attempt to substitute something
      for a context variable or s-o variable, will produce and Invalid_argument exception.
      
      In the term_std and dest_term'ed representation, v<|contexts|>[terms] is represented
      as var[v:v]{[contexts]; terms} where [contexts] is an xlist term with f-o variables
      as its leafs.
      
      This commit also refreshes half of the .prla (and simplifies a few proofs). This was
      necessary to make sure proofs still expand cleanly.
      

Changes  Path
+3 -3 metaprl/Makefile
+9 -4 metaprl/filter/base/filter_magic.ml
+8 -28 metaprl/filter/base/filter_summary.ml
+3 -3 metaprl/filter/base/filter_summary_util.ml
+21 -1 metaprl/filter/base/filter_type.ml
+6 -1 metaprl/filter/base/filter_util.ml
+2 -0 metaprl/filter/base/filter_util.mli
+2 -3 metaprl/filter/boot/proof_boot.ml
+5 -12 metaprl/filter/boot/sequent_boot.ml
+5 -2 metaprl/filter/boot/tactic_boot_sig.mlz
+42 -16 metaprl/filter/filter/filter_parse.ml
+4 -5 metaprl/filter/filter/filter_patt.ml
+39 -42 metaprl/filter/filter/term_grammar.ml
+1 -17 metaprl/filter/filter/term_grammar.mli
+3 -1 metaprl/filter/phobos/phobos_parser.mly
+6 -5 metaprl/refiner/refiner/refine.ml
+1 -1 metaprl/refiner/refiner/refine_error.ml
+4 -3 metaprl/refiner/refiner/refiner_ds.ml
+4 -3 metaprl/refiner/refiner/refiner_std.ml
+2 -2 metaprl/refiner/reflib/Files
+1 -1 metaprl/refiner/reflib/arith.ml
+100 -21 metaprl/refiner/reflib/ascii_io.ml
+6 -4 metaprl/refiner/reflib/ascii_io_sig.ml
+20 -13 metaprl/refiner/reflib/dform.ml
+45 -47 metaprl/refiner/reflib/jall.ml
+1 -1 metaprl/refiner/reflib/match_seq.ml
+10 -4 metaprl/refiner/reflib/refine_exn.ml
+47 -52 metaprl/refiner/reflib/simple_print.ml
+3 -3 metaprl/refiner/reflib/term_compare.ml
+1 -1 metaprl/refiner/reflib/term_match_table.ml
+1 -1 metaprl/refiner/refsig/refine_error_sig.ml
+1 -0 metaprl/refiner/refsig/term_addr_sig.ml
+43 -48 metaprl/refiner/refsig/term_base_minimal_sig.ml
+6 -10 metaprl/refiner/refsig/term_base_sig.ml
+3 -1 metaprl/refiner/refsig/term_hash_sig.ml
+4 -0 metaprl/refiner/refsig/term_man_minimal_sig.ml
+13 -1 metaprl/refiner/refsig/term_man_sig.ml
+11 -0 metaprl/refiner/refsig/term_meta_sig.ml
+1 -1 metaprl/refiner/refsig/term_sig.ml
+1 -33 metaprl/refiner/refsig/termmod_hash_sig.ml
+6 -0 metaprl/refiner/refsig/termmod_sig.ml
+6 -5 metaprl/refiner/rewrite/rewrite.ml
+2 -2 metaprl/refiner/rewrite/rewrite_build_contractum.ml
+53 -44 metaprl/refiner/rewrite/rewrite_compile_contractum.ml
+95 -78 metaprl/refiner/rewrite/rewrite_compile_redex.ml
+11 -9 metaprl/refiner/rewrite/rewrite_debug.ml
+45 -28 metaprl/refiner/rewrite/rewrite_match_redex.ml
+4 -4 metaprl/refiner/rewrite/rewrite_types.ml
+24 -20 metaprl/refiner/rewrite/rewrite_util.ml
+2 -2 metaprl/refiner/rewrite/rewrite_util_sig.ml
+1 -1 metaprl/refiner/term_ds/Files
+175 -64 metaprl/refiner/term_ds/term_addr_ds.ml
+7 -1 metaprl/refiner/term_ds/term_addr_ds.mli
+109 -120 metaprl/refiner/term_ds/term_base_ds.ml
+2 -1 metaprl/refiner/term_ds/term_ds.ml
+13 -8 metaprl/refiner/term_ds/term_ds_sig.ml
+77 -65 metaprl/refiner/term_ds/term_man_ds.ml
+199 -220 metaprl/refiner/term_ds/term_op_ds.ml
+89 -83 metaprl/refiner/term_ds/term_subst_ds.ml
+35 -12 metaprl/refiner/term_gen/term_addr_gen.ml
+3 -0 metaprl/refiner/term_gen/term_addr_gen.mli
+19 -9 metaprl/refiner/term_gen/term_hash.ml
+7 -2 metaprl/refiner/term_gen/term_header_constr.ml
+134 -35 metaprl/refiner/term_gen/term_man_gen.ml
+176 -1 metaprl/refiner/term_gen/term_meta_gen.ml
+12 -1 metaprl/refiner/term_gen/term_meta_gen.mli
+31 -7 metaprl/refiner/term_gen/term_shape_gen.ml
+6 -4 metaprl/refiner/term_gen/term_shape_gen.mli
+3 -68 metaprl/refiner/term_std/term_base_std.ml
+1 -1 metaprl/refiner/term_std/term_std.ml
+2 -7 metaprl/refiner/term_std/term_std_sig.ml
+10 -13 metaprl/refiner/term_std/term_subst_std.ml
+38 -26 metaprl/support/display/base_dform.ml
+47 -43 metaprl/support/shell/shell.ml
+8 -19 metaprl/support/shell/shell_package.ml
+5 -1 metaprl/support/shell/shell_rewrite.ml
+8 -19 metaprl/support/shell/shell_root.ml
+4 -0 metaprl/support/shell/shell_rule.ml
+1 -0 metaprl/support/shell/shell_sig.mlz
+34 -10 metaprl/support/shell/shell_state.ml
+3 -3 metaprl/support/shell/shell_state.mli
+0 -22 metaprl/support/tactics/dtactic.ml
+1 -1 metaprl/support/tactics/tactic_cache.ml
+1 -1 metaprl/support/tactics/top_tacticals.ml
+2 -2 metaprl/support/tactics/typeinf.ml
+8 -5 metaprl/support/tactics/var.ml
+1 -0 metaprl/support/tactics/var.mli
+14305 -14357 metaprl/theories/czf/czf_itt_bool.prla
+3371 -3374 metaprl/theories/czf/czf_itt_coset.prla
+3063 -2709 metaprl/theories/czf/czf_itt_dall.prla
+2037 -1964 metaprl/theories/czf/czf_itt_dexists.prla
+4319 -4104 metaprl/theories/czf/czf_itt_eq.prla
+7208 -6568 metaprl/theories/czf/czf_itt_equiv.prla
+6238 -7018 metaprl/theories/czf/czf_itt_group.prla
+8150 -7641 metaprl/theories/czf/czf_itt_hom.prla
+10701 -10147 metaprl/theories/czf/czf_itt_ker.prla
+4298 -4899 metaprl/theories/czf/czf_itt_member.prla
+5120 -5060 metaprl/theories/czf/czf_itt_nat.prla
+2198 -2342 metaprl/theories/czf/czf_itt_normal_subgroup.prla
+1874 -1812 metaprl/theories/czf/czf_itt_pair.prla
+4579 -4310 metaprl/theories/czf/czf_itt_power.prla
+4180 -4331 metaprl/theories/czf/czf_itt_sep.prla
+5120 -5294 metaprl/theories/czf/czf_itt_set.prla
+1611 -1680 metaprl/theories/czf/czf_itt_set_bvd.prla
+6489 -6709 metaprl/theories/czf/czf_itt_union.prla
+1 -1 metaprl/theories/fir/mfir_tr_exp.ml
+1834 -1641 metaprl/theories/fol/cfol_itt_all.prla
+2221 -2447 metaprl/theories/fol/cfol_itt_and.prla
+1389 -1349 metaprl/theories/fol/fol_itt_and.prla
+823 -738 metaprl/theories/fol/fol_not.prla
+3283 -3729 metaprl/theories/fol/fol_prop.prla
+3382 -4417 metaprl/theories/itt/itt_bisect.prla
+9925 -10195 metaprl/theories/itt/itt_bool.prla
+3994 -4120 metaprl/theories/itt/itt_collection.prla
+4 -6 metaprl/theories/itt/itt_derive.ml
+6226 -6647 metaprl/theories/itt/itt_dfun.prla
+4391 -4453 metaprl/theories/itt/itt_disect.prla
+4 -4 metaprl/theories/itt/itt_equal.ml
+0 -0 metaprl/theories/itt/itt_fset.prla