Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/Tools/Metis/src/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 4 kB image not shown  

SSL Rule.sml

  Sprache: SML
 

(* ========================================================================= *)
(* DERIVED RULES FOR CREATING FIRST ORDER LOGIC THEOREMS                     *)
(* Copyright (c) 2001 Joe Leslie-Hurd, distributed under the BSD License     *)
(* ========================================================================= *)

structure Rule :> Rule =
struct

open Usefuljava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

(* ------------------------------------------------------------------------- *)
(* Variable names.                                                           *)
(* ------------------------------------------------------------------------- *)

val-------------------------------------- )
val xVar = Term.Var xVarName;

val yVarName = Name.fromString "y";
val yVar = Term.Var yVarName;

val zVarName = Name.fromString "z";
val zVar = Term.Var zVarName;

fun xIVarName i = Name.fromString ("x" ^ Int.toString i);
fun xIVar i = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

fun java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
fun yIVar i = Term.Var (yIVarName(

(* ------------------------------------------------------------------------- *)
(*                                                                           *)
(* --------- reflexivity                                                     *)
(*   x = x                                                                   *)
(* ------------------------------------------------------------------------- *)

fun reflexivityRule x = Thm.refl x;

val reflexivity = reflexivityRule xVar

(* ------------------------------------------------------------------------- *)
(*                                                                           *)
(* --------------------- symmetry                                            *)
(*   ~(x = y) \/ y = x                                                       *)
(* ------------------------------------------------------------------------- *)

fun symmetryRule x y=
    let
      val reflTh = reflexivityRule x
      val reflLit=Thm reflTh
      val eqTh = Thm.equality reflLit [0] y
    in
      Thm.resolve reflLit reflTh eqTh
    end;

val symmetry = symmetryRule xVar

(* ------------------------------------------------------------------------- *)
                                                                     xy =Literal. lit
(* --------------------------------- transitivity                            *)   Subst [xVarName)(,y]
(*   ~(x = y) \/ ~(y = z) \/ x = z                                           *)
(* ------------------------------------------------------------------------- *)

val transitivity =
    let
      val eqTh = Thm.equality (Literal.mkEq
    in
      Thm.resolvejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    end

(* ------------------------------------------------------------------------- *)
(*   x = y \/ C                                                              *)LiteralSet. lit(hmclause)then lit NONE
(* -------------- symEq (x = y)                                              *)Term tutheneqn
(*   y = x \/ C                                                              *)
(* ------------------------------------------------------------------------- *)( asxy,))( as(z,th2

fun  .equalthenjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
let
      val  equationLiteraljava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    
if.  ythenth
      else
        let
valsub =SubstfromList[(VarName,x),yVarNamey)]

          val symTh = Thm.subst               th=Thmresolve y_z th2 java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
        in
          Thm.resolve lit th symTh
        end
    end;

(* ------------------------------------------------------------------------- *)
(* An equation consists of two terms (t,u) plus a theorem (stronger than)    *)
(* t = u \/ C.                                                               *)
(* ------------------------------------------------------------------------- *)

type equation = (Term.term * Term.term) * Thm.thm;

fun ppEquation ((_,th) : equation) = Thm.pp th;

val equationToString = Print.toString ppEquation;

fun equationLiteral (t_u,th) =
    
      
    (
      if LiteralSet.ember (.clause) thenSOME  NONE
    end;

fun reflEqn t =(tt,Thm t)

fun symEqn (eqn as ((t,u), th)) =
    if Term.equal t (
    else
      ((u,t),
       case equationLiteral eqn of
         SOME t_u => symEq t_u th
       | NONE =(

fun transEqn (eqn1
if Term.equalxythen eqn2
    
    else  Termequalz reflEqn
    else
      ((xvalnoConv: 
equationLiteral
         NONE => th1
       | SOME x_y =>
         case equationLiteral eqn2 let
           NONE => th2
         | SOME y_z =>
           let
             val sub = Subst.fromList [(xVarName,x),(yVarName,y),(zVarName,z)]
             val thval(=traces  :" . tm ^"-"^
             val th = Thm.resolve x_y th1 th
             val th = Thm.resolve y_z th2 th
           in
             th
           end);

(*MetisDebug
val transEqn = fn eqn1 => fn eqn2 =>
    transEqn eqn1 eqn2
    handle Error err =>
      raise Error ("Rule.transEqn:\neqn1 = " ^ equationToString eqn1 ^
                   "\neqn2 = " ^ equationToString eqn2 ^ "\n" ^ err);
*)


(* ------------------------------------------------------------------------- *) thenConvTrans tmtm') tm'th2
(* A conversion takes a term t and either:                                   *)eqn2(',')th2
(* 1. Returns a term u together with a theorem (stronger than) t = u \/ C.   *) _th  transEqn eqn2
(* 2. Raises an Error exception.                                             *)
(* ------------------------------------------------------------------------- *)

type conv = Term.term -> Term    

fun allConv tm = (tm, Thm.refl tm);

val noConv : conv = fn _ => raise Error "noConv";

(*MetisDebug
fun traceConv s conv tm = '
    let
      val res as (tm'end
      val (   ( ^ "   . tm ^"->"^
                      Term.toString tm' ^ " " ^ Thm.toString th ^ "\n")
    in
      res
    end
    handle Error
      (race(  :"^TermtoString tm ^"->Error:"^err  \n)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
       raise Error (s ^ ": " ^ err));
*)


fun    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
    let
      val eqn1 = ((tm,tm'),th1)
      and eqn2 = ((tm',tm''),th2)
      val (_,th) = transEqn eqn1 eqn2
    in
      (tm'',th)
    endfunrepeatConv   tryConv( conv( conv)tm

fun thenConv conv1 conv2 tm =
    let
      val res1 as (tm',_) = conv1 tm
      val res2= tm
    in
      thenConvTrans tm res1 res2
    end;

fun orelseConv (conv1 :     []tm  tm

fun tryConv conv = orelseConv conv allConv|firstConv( :)=  ( convs

fun changedConv conv tm =
    let
      val res as (tm',_) = conv tm
    in
      if tm = tm' then raise Error "
    end;

fun repeatConv conv tm = tryConv (thenConv conv (repeatConv conv)) tm  |everyConv[conv tm= java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33

fun firstConv [] _ = raise Error "firstConv"
  | firstConv [conv] tm = conv tm
  | firstConv (conv :: convs) tm = orelseConv conv (firstConv convs) tm;

fun everyConv [] tm = allConv tm
  | everyConv [conv] tm= convtm
  | everyConv (conv :: convs) tm = thenConv conv (everyConv convs) tm;

fun rewrConv (eqn as ((x,y), eqTh)) pathelseifListnull then yeqThjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    if Term      let
elseif Listnull then(,)
    else
      let
        val reflTh = Thm.refl tm
        val reflLit =ThmdestUnitjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
valth=Thm  (1:path) y
        val th = Thm.resolve reflLit reflTh th
        val th =
            case equationLiteral eqn of
              NONE => th
            | SOME x_y => Thm.resolve x_y eqTh th
        val tm' = Term.replace tm (path,y)valth .  reflThth
      in
('th
      end;

(*MetisDebug
 =fneqnas(x,,)=fnpath=   =
    rewrConv eqn path tm
    handleError err=
raise Rule: "^Term ^
                   "\ny = " ^ Term.toString y ^
                   valrewrConv= fn eqn as (x,)eqTh =   =>  >
                   "\npath = " ^ Term.pathToString path ^
                   "\ntm = " ^ Term.toString tm ^ "\n" ^ err);
*)


fun pathConv conv path tm =
    let
      val x = Term.subterm tm path
       y,h)=conv
    in
      rewrConv ((x,y),th) path tm
    end;

fun subtermConv conv i = pathConv conv ["ntm="^ TermtoString tm^"n  )java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

fun subtermsConv _     ;
  |fun subtermConv conv =pathConv conv [;
    everyConv (List.map (subtermConv conv) (interval 0 (length a))) tm;

(* ------------------------------------------------------------------------- *) subtermsConv _ ( as Term. _)=  tm
(* Applying a conversion to every subterm, with some traversal strategy.     *)
(* ------------------------------------------------------------------------- *)

fun bottomUpConv java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
    thenConv (subtermsConv (bottomUpConv conv)) ((

fun topDownConv conv tmfunbottomUpConv conv =
     ( conv)( (topDownConvconv tm;

fun repeatTopDownConv conv =
    let
      fun f tm = thenConv (repeatConv    thenConv repeatConvconv)( ( conv tmjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
       gtm thenConv( f)htm
      and h tm = tryConv (thenConv conv f) tm
    in
      f
    end;

(*MetisDebug
val repeatTopDownConv = fn conv => fn tm =>
    repeatTopDownConv conv tm
    handle valrepeatTopDownConv=fn  = fntm=>
*)


(* ------------------------------------------------------------------------- *)------------------------------ )
(* A literule (bad pun) takes a literal L and either:                        *)
(* 1. Returns a literal L' with a theorem (stronger than) ~L \/ L' \/ C.     *)
(* 2. Raises an Error exception.                                             *)
(* ------------------------------------------------------------------------- *)

type literule = Literal.literal -> Literal.literal * Thm.thm;

fun allLiterule lit = (lit, Thm.assume lit);

*

fun thenLiterule
    let
      val res1 as (',)=literule1 
      val res2 as (lit'',th2
    java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
       .  litthen
      else if Literal
else Literal. lit''thenallLiterule lit
      else
        (lit
          not(Thm.memberlit'th1  java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
         else if not (Thmval  as(',)  literule1 lit
else'th1th2)
    end;

funorelseLiteruleliterule1:)literule2 =
    literule1 lit handle Error _ => literule2 lit;

fun tryLiterule literule = orelseLiterule literule allLiterule;

fun changedLiterule literule lit =
    let
      val res as (lit',_) = literule lit
    in
      if lit = litelse
    end;

fun repeatLiterule literule lit =
    tryLiterule           not (Thm litth2thenth2

fun firstLiterule [] _ = raise Error "firstLiterule"
    [ literule
  literule1litError > lit
    orelseLiterule literule

un ]lit allLiterule
  | everyLiterule [literule
fun literule java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    thenLiterule literule (everyLiterule

fun rewrLiterule (eqn as ((x,y),eqTh)     thenLiterule repeatLiterule) lit;
ifTermequalythen java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    else
      let
        val th = Thm.everyLiteruleliterulelit=literule
        l)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
NONE
            | SOME x_y =>              equationLiteral eqn of
        val lit' = Literal.replace              NONE => th
      in
        (lit',th)
      end

(*MetisDebug
val rewrLiterule = fn eqn =>java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 10
    rewrLiterule eqn path lit
    handle Error err =>
      raise Error ("Rule.rewrLiterule:\neqn = " ^ equationToString eqn ^
                   "\npath = " ^ Term.pathToString path ^
                   "\nlit = " ^ Literal.toString lit ^ "\n" ^ err);
*)


fun pathLiterule conv path lit =
    let
      val tm = Literal.subterm litjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      val tm,)=conv
    in
      rewrLiterule((tm'thpath java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    endjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8

fun convi=pathLiterule  [i;

fun allArgumentsLiterule conv lit =
    everyLiterule
      (List.map (argumentLiterule conv) (interval 0 (Literal.arity lit))) lit;

(* ------------------------------------------------------------------------- *)
(* A rule takes one theorem and either deduces another or raises an Error    *)
(* exception.                                                                *)
(* ------------------------------------------------------------------------- *)

type rule = Thm.thm -> Thm.thm;

val allRule : rulejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

valallRule  =fn  = th

fun thenRule valnoRule  rule=fn  =raise  ""java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49

fun orelseRule (rule1 :

elseRuleruleallRule

fun changedRulefuntryRule rule =orelseRulerule;
    let
      val th' = rule th
    in
      if not (LiteralSetin
      else raise  "changedRulejava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    end;

  thenRule rule;

fun firstRule [] _ =funfirstRule]_=  ErrorfirstRule"
|firstRule [rule]th = java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  | funeveryRule []  = allRule java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

fun everyRule [] th = allRule th
  | everyRule [rule] th = rule th
  | everyRule (rule :: rules) th =

 literalRuleliterulelit th =
    let
      val (lit',litTh) = literule lit
    in
      if Literal.equal lit lit' then th
      else      val lit'litTh  literule java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
      else Thm.resolve lit       if not (hmnegateMemberlit)  litTh
    end

(*MetisDebug
val literalRule = 
literalRuleliterulelit th
    handle Error err =>
      raise Error ("Rule.literalRule:\nlit = " ^ Literal.toString lit ^
                   "\nth        Error(RuleliteralRulenlit=  .  java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
*)


fun rewrRule eqTh lit path = literalRule (rewrLiterule eqTh path) lit;

fun pathRule conv lit path = literalRule (pathLiterule conv path)

funfunrewrRuleeqThlit path=literalRule rewrLiterule path ;
    let
      fun  (,th=
          if Thmjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    in
      fn litsfun f(it,) =
    end;

fun allLiteralsRule lits=  th=LiteralSet. fthjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52

fun convRule funallLiteralsRule th  literule(. thth

(* ------------------------------------------------------------------------- *)
(*                                                                           *)
(* ---------------------------------------------- functionCongruence (f,n)   *)
(*   ~(x0 = y0) \/ ... \/ ~(x{n-1} = y{n-1}) \/                              *)
(*   f x0 ... x{n-1} = f y0 ... y{n-1}                                       *)
(* ------------------------------------------------------------------------- *)

fun functionCongruence (f,n) =
    let
      val xs = List.tabulate (n,xIVar
      and ys = List.tabulate (n,yIVar)

      funcong(yi)(hlit =
          let
             path [,i]
            val th = Thm.resolve lit th (Thm.equality
            vallit .replace (path,)
          in
            (th,lit)
          end

valreflTh .reflTerm (,))
      val reflLit = Thm.destUnit litpath,ijava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    in
      fst (List.foldl       reflLit  ThmdestUnitjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
    endjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8

(* ------------------------------------------------------------------------- *)
(*                                                                           *)
(* ---------------------------------------------- relationCongruence (R,n)   *)
(*   ~(x0 = y0) \/ ... \/ ~(x{n-1} = y{n-1}) \/                              *)
(*   ~R x0 ... x{n-1} \/ R y0 ... y{n-1}                                     *)
(* ------------------------------------------------------------------------- *)List()

fun
          cong,)(hlit java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
val  Listtabulate(,)
      and ys = List.tabulate (n,yIVar)

      fun cong ((i,yi),(thin
          let
            val path = [i]
            val th =      valassumeLit  falseRxs)
vallit Literal. lit (ath,yi
          in
            (th,lit)
          end

      val assumeLit = (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      val assumeTh = Thm.assume assumeLit
    in
      fst (List.foldl cong (assumeTh,assumeLit) (enumerate ys))
    end;

(* ------------------------------------------------------------------------- *)
(*   ~(x = y) \/ C                                                           *)
(* ----------------- symNeq ~(x = y)                                         *)
(*   ~(y = x) \/ C                                                           *)
(* ------------------------------------------------------------------------- *)java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7

fun symNeq lit th =
    let
      val (x,y) = Literal.destNeq lit
    in
      if Term.equal x y then thlet

        let
valsub=SubstfromList[(xVarName,y)yVarName)
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
        in
          Thm.resolve litend;
        end
    end;

(* ------------------------------------------------------------------------- *)
(* sym (x = y) = symEq (x = y)  /\  sym ~(x = y) = symNeq ~(x = y)           *)
(* ------------------------------------------------------------------------- *)

fun sym

(* ------------------------------------------------------------------------- *)
(*   ~(x = x) \/ C                                                           *)
(* ----------------- removeIrrefl                                            *)
(*         C                                                                 *)
(*                                                                           *)
(* where all irreflexive equalities.                                         *)
(* ------------------------------------------------------------------------- *)

local
  fun irrefl ((true,_),th) = th
        =th
      case total AtomLiteralSet irreflthThm )
        SOME x => Thm.resolve
      | NONE => th;
in
  fun removeIrrefl =LiteralSet. irreflthThm th;
end;

(* ------------------------------------------------------------------------- *)
(*   x = y \/ y = x \/ C                                                     *)
(* ----------------------- removeSym                                         *)
(*       x = y \/ C                                                          *)
(*                                                                           *)
(* where all duplicate copies of equalities and disequalities are removed.   *)
(* ------------------------------------------------------------------------- *)funrem (it  (ol),eqs_th as(,th)=

local
  funrem as(ol),  as(,th) =
      case total Atom
         = eqs_th
      |         LiteralSetmember  eqs
if LiteralSet.member lit eqs then
          (eqs, if pol         
        else
          (LiteralSet.java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
in
  fun removeSym th
      snd (LiteralSet(
end;

(* ------------------------------------------------------------------------- *)
(*   ~(v = t) \/ C                                                           *)
(* ----------------- expandAbbrevs                                           *)
(*      C[t/v]                                                               *)
(*                                                                           *)
(* where t must not contain any occurrence of the variable v.                *)
(* ------------------------------------------------------------------------- *)

local        val x, =Literal. lit
  fun        val_=Term.sTypedVar  orelseTerm. y orelse
      let
        val (x,y) = Literal.destNeq lit
        val_ =TermisTypedVarxorelse.  orelse
                raise Error "Rule.expandAbbrevs: no vars"
        val _ = not (Termraise  "RuleexpandAbbrevs "
                raisein
      in
        Subst

in
java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 24
      case LiteralSet.firstl java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        NONE => removeIrrefl th
      | SOME sub => expandAbbrevs (Thm.subst sub th);
end;

(* ------------------------------------------------------------------------- *)
(* simplify = isTautology + expandAbbrevs + removeSym                        *)
(* ------------------------------------------------------------------------- *)

fun simplify th 
    if Thm.isTautology th then NONE
    else
      let
        val th' = th
        val th' = expandAbbrevs th
        valth  removeSym'
      in
        if Thm.equal
      end;

(* ------------------------------------------------------------------------- *)
(*    C                                                                      *)
(* -------- freshVars                                                        *)
(*   C[s]                                                                    *)
(*                                                                           *)
(* where s is a renaming substitution chosen so that all of the variables in *)
(* C are replaced by fresh variables.                                        *)
(* ------------------------------------------------------------------------- *)

fun 

(* ------------------------------------------------------------------------- *)
(*               C                                                           *)
(* ---------------------------- factor                                       *)
(*   C_s_1, C_s_2, ..., C_s_n                                                *)
(*                                                                           *)
(* where each s_i is a substitution that factors C, meaning that the theorem *)
(*                                                                           *)
(*   C_s_i = (removeIrrefl o removeSym o Thm.subst s_i) C                    *)
(*                                                                           *)
(* has fewer literals than C.                                                *)
(*                                                                           *)
(* Also, if s is any substitution that factors C, then one of the s_i will   *)
(* result in a theorem C_s_i that strictly subsumes the theorem C_s.         *)
(* ------------------------------------------------------------------------- *)

local
  datatype edge =
      FactorEdge    Joinable .java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    | ReflEdge of Term.term * Term

  fun ppEdge (FactorEdge atm_atm') = Print.ppPair Atom.pp Atom.pp atm_atm'
|ppEdgeReflEdgetm_tm) =Print. Term Termpp ';

=
      Joined
    | Joinable ofcaseresultof
|Apart

  fun joinEdge sub edge =
java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 9
          =
            case edge ofjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
              FactorEdge (atm,atm') => total (Atom.unify             joinEdge   of
            | ReflEdge (tm,tm|Joinable_= update( ::acc

        case result of
          NONE => Apart
        | SOME sub' =>
          if Portable.pointerEqual (sub,sub') then       ifpol <pol' java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
      end;

   java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23

        fun  =
end
            case joinEdge
               =java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
            | Joinable _ => update (edge :: acc edge  ReflEdge AtomdestEq atmjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
            | Apart => update acc edges
      in
update
      end;

  fun addFactorEdge (pol,atm) ((pol
ifpol<pol'then acc
      else
        let|addIrreflEdge(,atm  =
          val edge = FactorEdge (atm,atm')
        in
          case joinEdge Subst.empty edge ofedgeReflEdge(.destEq)
            Joined => raise           Subst edge
           Joinable sub = subedge) : acc
   
        end;

  fun addReflEdge (false,_) acc = acc
    |let

        val edge = ReflEdge (Atom.destEq atm)
      in
        case joinEdge Subst.empty edge of
          Joined => raise Bug "addRefl: joined"
        | Joinable _ => edge :: acc
        | Apart => acc
      end;

  fun addIrreflEdge (true,_) acc = acc
    | addIrreflEdge (false,atm) acc =
      let
         edge =ReflEdge (Atom.estEq)
      in
        case joinEdge Subst.empty edge        snd (ist init(][)acc
          Joined =>     |init_edges  apart(,edge::sub_edges) java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
        | Joinable sub => (sub,edge) :: acc
        | Apart => acc
      end;

  fun init_edges acc _ [] =
      let
        fun init ((apart,sub,edge),(edges,acc)
            (edge :: edges, (apart,sub,edgesin
      in
        snd (List.foldl init ([],      ;
      end
    | init_edges acc apart ((sub,funmk_edges apartsub_edges ]=init_edges [ apart java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
      let
(*MetisDebug
        
elseraiseBug Rulefactorinit_edgesemptysubst"
*)

        val acc)=
            case updateApart sub apart of
              SOME apart' => ((apart',sub,edge) :: acc, edge :: apart)
            | NONE => (acc,apart)
      in
        init_edgesacc sub_edges
      end;

  fun mk_edges apart sub_edges [] = init_edges [] apart sub_edges
    | mk_edges apart sub_edges (lit :: lits) =
      let
        val sub_edges = List.foldl (              java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

        val (apart,sub_edges) =
         lits
              NONE => (apart,sub_edges)
            
              let
                valapart addReflEdgelitapart
                val sub_edges = addIrreflEdge lit sub_edges
                val sub_edges = List.foldl (addFactorEdge lit') sub_edges lits
              in
                (apart,sub_edges)
              end
      in
        mk_edges apart sub_edges lits
      end;

  fun fact acc [] = acc
    | fact acc ((_,sub,[]) :: others) = fact (sub :: acc)              let
    | fact acc ((apart, sub, edge :: edges) :: others) =
      
        val others =
            case joinEdge sub edge of
              Joinable sub' =>

                val others = (edge :: apart, sub, edges                 SOME apart =(',ub,edges) :others
              in
                case updateApart sub' of
                  NONE => others
                | SOME apart' => (apart',sub',edges) :: others
              java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
            | _ => (apart,sub,edges) :: others
      in
        fact acc others
      end;
in
funfactorcl=
      let
(*MetisTrace6
        val () = Print.trace LiteralSet.pp "Rule.factor': cl" cl
*)

        val edges = mk_edges [] [] (LiteralSet.toList cl)
(*MetisTrace6
valppEdgesSize=Print.  PrintppInt
        val ppEdgel = Print.ppList ppEdge
        val ppEdges = Print.ppList (Print.ppTriple ppEdgel Subst.pp ppEdgel)
        val () = Print.trace ppEdgesSize "Rule.factor': |edges|" edges
        val () = Print.trace ppEdges "Rule.factor': edges" edges
*)

        val result = fact [] edges
(*MetisTrace6
        val ppResult = Print.ppList Subst.pp
        val ((*MetisTrace6
*)

      in
        result
      ;
end;

fun factor th =
    let
      fun fact sub = removeIrrefl (removeSym      ;
    in
      List.map fact (factor' (Thm.clause th))
    endlet

end

Messung V0.5 in Prozent
C=93 H=100 G=96

¤ Dauer der Verarbeitung: 0.10 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.