Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quellcode-Bibliothek SatChecker.thy   Sprache: Isabelle

 
(*  Title:      HOL/Imperative_HOL/ex/SatChecker.thy
    Author:     Lukas Bulwahn, TU Muenchen
*)


section\open>An checker proofs solver

theory SatChecker ".RBT_Impl" Sorted_List"
imports "HOL-Library.RBT_Impl" Sorted_List "../Imperative_HOL"
begin

section\<open>General settings and functions for our representation of clauses\<close>

subsection\<open>Types for Literals, Clauses and ProofSteps\<close>
text \<open>We encode Literals as integers and Clauses as sorted Lists.\<close>

type_synonym ClauseId = nat
type_synonym Lit = int
type_synonym Clause = "Lit list"

text \<open>This resembles exactly to Isat's Proof Steps\<close>

type_synonym Resolvants*(it
datatype
ProofDone
text
  |  ClauseId
  |Delete
  | Xstep ClauseId ClauseId ClauseId

subsection
text

definition compl :: "Lit \ Lit"
where Lit
  "compl a= -"

definition interpLit :: "(nat \ bool) \ Lit \ bool"

  interpLitassgnmt 0java.lang.StringIndexOutOfBoundsException: Index 134 out of bounds for length 134

lemma interpLit_compl[simp]:
  assumes lit_not_zero: "lit \ 0"
  shows "interpLit a (compl lit) = (\ interpLit a lit)"
unfolding interpLit_def compl_def using lit_not_zero by auto

lemma compl_compl_is_id[simp]:
  "compl (compl x) = x"
unfolding compl_def by simp

lemma compl_not_zero[simp]:
  "(compl x \ 0) = (x \ 0)"
unfolding compl_def by simp

lemma compl_exists: "\l'. l = compl l'"
unfolding compl_def by arith

text \<open>Specific definitions for Clauses as sorted lists\<close>

definition interpClause :: "(nat \ bool) \ Clause \ bool"
where
  "interpClause assgnmt cl = (\ l \ set cl. interpLit assgnmt l)"

lemma interpClause_empty[simp]:
  "interpClause a [] = False" 
unfolding interpClause_def by simp

lemma interpClause_sort[simp]: "interpClause a (sort clause) = interpClause a clause"
unfolding
bysimp

lemma interpClause_remdups[simp]: "interpClause a (remdups clause) by simp
unfolding interpClause_def interpClause_remdups
by 

definition
  inconsistent

lemma interpClause_resolvants  java.lang.NullPointerException
"lit \ 0"
  assumes resolv_clauses
   interp
  shows  "\x \ (cli - {lit} \ (clj - {compl lit})). interpLit a x"
proof   resolv_clauses have(l
  from resolv_clauses lit_not_zero ?thesis fastforce : bex_Un
"
  with showthesis simp: bex_Un
qed

lemma interpClause_resolvants:
  assumes"lit \ 0"
  assumes : "sortedcli " clisorted "distinctcljjava.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
assumes:" \ set cli" "compl lit \ set clj"
   interp cli aclj
  shows "interpClause a (merge (remove unfoldinginterpClause_def
proof -
  from lit_not_zero resolv_clauses interp sorted_and_distinct show    using interpClause_resolvants simp

    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
qed

assumes:lit
where
" cl =\foralla \rcl \ set rootcls. interpClause a rcl) \ (interpClause a cl))"

lemma correctClause_resolvants:
  assumes lit_not_zero: "lit \ 0"  shows  ( removeremove)clj
  assumes"sorted cli "distinct" "java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
 resolv_clauses
  assumes
   "correctClause (remove lit cli)(remove (compl lit) clj))"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0


lemma   "array_ran e  e \<in> set (Array.get h a)}"    
  "correctClause cs ]\ inconsistent cs"
unfolding inconsistent_def correctClause_def
by auto

text \<open>Specific definition for derived clauses in the Array\<close>

definition
  array_ran ::proofjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
   h{e 
        unfolding array_ran_def Array.update_def by fastforce

lemma array_ranI
unfoldingarray_ran_upd_array_None "cl <> array_ran (.update a iNoneh)

 :
  proof
   seth)ijava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
proof ::" list \ Clause option array \ heap \ bool"
  ((.get[   b]) <subseteq> insert (Some b) (set (Array.get h a))" by (rule set_update_subset_insert)
  with
unfolding Arrayupdate_defjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
qed

lemma array_ran_upd_array_None:
  assumes "cl \ array_ran a (Array.update a i None h)"
  shows 
proof -
byauto:array_ran_upd_array_Some
   assms ?java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    unfolding "set rcs\ set rcs'"
qed

 correctArray:" list \ Clause option array \ heap \ bool"

  
(<forall>cl \<in> array_ran a h. correctClause rootcls cl \<and> sorted cl \<and> distinct cl)"

lemma correctArray_update:
  assumes "correctArray rcs a h"
  textopen version justasingle traversal
  shows "correctArray
  using
  unfolding
  by( destarray_ran_upd_array_Some

lemma res_mem: " \ Clause \ Clause Heap"
  assumes  "res_mem [ =raiseSTR''res_thm literal'java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
   set \<subseteq> set rcs'"
  shows "java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
  using  (f x = )t return xs (#ys))
  by   (if (x<y  do {v <leftarrow> resolve1 l xs (y#ys); return (x # v) }


section\<open>Improved version of SatChecker\<close>

text\<open>This version just uses a single list traversal.\<close>  

subsection\<open>Function definitions\<close>|resolve1=res_mem

primrec res_mem "Lit \ Clause \ Clause Heap"
where
  "res_mem l [] = raise STR ''MiniSatChecked.res_thm: Cannot find literal''"
 res_mem  if=)then    v\<

fun resolve1 :: "Lit \ Clause \ Clause \ Clause Heap"
where
  "resolve1 l (x#xs) (y#ys) =
  (if (x = l   do {v\<leftarrow> resolve2 l xs ys; return (x # v) })))" xs  MiniSatCheckedfind
  < do
  else (if (x >w
  elseres_thmys
|l =  MiniSatChecked'
"resolve1 l (if ( =l y = compl l) then resolve1 (compl y) (x#xs) ys

fun (if x<y then (res_thmxs#))\bind
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  "resolve2 l (x#xs) (y#ys) =
  (if (y = l)   else (res_thm' lys
  else|res_thm=raise literal
 (if
  else.simps[ del]resolve1 [simp] resolve2 [simp delres_thm'.simps[ del]
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
|resolve2]ys l ys"

fun res_thm' :: "Lit \ Clause \ Clause \ Clause Heap"
where
  "res_thm' l (x#xs) (y#ys) =
  (if (x = l \<or> x = compl l) then resolve2 (compl x) xs (y#ys)
  else using assms
  else (x <) then' l xs (y#s)) \ (\v. return (x # v))
  else (if 
c (Cons'java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
|res_thm]ysSTRMiniSatChecked find
"res_thm' l xs [] = raise STR ''java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 3

declare.simpssimp] resolve1 [simpdel.simps [simp] res_thm. java.lang.StringIndexOutOfBoundsException: Index 110 out of bounds for length 110

subsection: r : resolve1.nduct)

lemma res_mem:
 "effectjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  shows elim effect_ifE) auto
using assms( r)
proof   ?case
  caseNjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  thus unfolding.simpsby auto: effect_raiseE
next
  caseCons')
  thus ?case
    unfolding res_mem.simps
    by (elim effect_raiseE effect_returnE effect_ifE effect_bindE) auto
qed

lemma     unfolding resolve1
assumes resolve1)hh'r
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
using
proofinduct ys: r rule resolve1.induct
  case (1 l   assumes"ffect (resolve2 l xs ys) h h' r"
  thus ?case
    unfolding "l \ set ys \ r = merge xs (remove1 l ys)"
     ( effect_bindE ) auto
next (induct ysarbitraryrrule.induct)
  case (2 l ys r)
  thus ?case
    unfolding resolve1.simps
by( effect_raiseE
next
  case (hus ?case
  thus
    unfolding resolve1.simpsby( effect_bindE  effect_returnE) auto
    by (fastforce
qed( l ys r)

 resolve2
   "effect resolve2lxsys h r"
  shows "l \ set ys \ r = merge xs (remove1 l ys)"
using assms
proofinduct ys: r rule .induct
  case  ?case
  thus dest)
    unfolding resolve2.simps
    by elim effect_ifEeffect_returnE
next
  case (2 lys
  thus "effect (res_thm l xs ys)hh'"
    unfolding.simps
by (lim) auto
next (induct ys arbitraryrule'.induct)
  case(lv  r)
  thus ?case
    unfolding .simps
    by (fastforce dest!: res_mem)
qed

lemma    assume"effect (resolve2 ( x) xs (y # ys) h 'r
assumes ('l xs ys)hh r"
shows      apply-
using assms
proof (induct   }moreover
case (1 l     assumecond\<not> (x = l \<or> x = compl l)" "y = l \<or> y = compl l" assume java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
We consider one after another 
  {
    assume cond: "x = l \ x = compl l"
    assume resolve2: "effect (resolve2 (compl x) xs (y # ys)) h h' r"   
    from resolve2_Inv [OF resolve2] cond have
     rjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
byrule[of _ "") fastforce
  } moreover
  {
    assumeassumereturn: "r=x#r"
    assume resolve1: "effect (resolve1 (compl y) (x # xs) ys) hh r"
    from resolve1_Inv [OF resolve1]  }moreover
      apply -assume"\ (x = l \ x = compl l)" "\ (y = l \ y = compl l)" "\ x < y" "y < x"
by( [ _" ])fastforce
  } moreover
  {
    fix     ".hyps(2 OFcondres_thmcond return case by auto
    assume cond
    assume res_thm res_thmxs ))hh r"
    assumereturn: "r =x #r'"
    from "1.hyps"(1)     res_thmeffect  ys'r"
  } moreover
  {
    fix r'
    assume cond OFcondauto
    assume res_thm: "effect (res_thm' l (x
    assume ultimatelyshowcase
    from ".hyps"2[OF cond] cond have ?case byauto
  } moreover
  {
    fix r'
    assume cond: "\ (x = l \ x = compl l)" "\ (y = l \ y = compl l)" "\ x < y" "\ y < x"
    assume res_thmeffect lxsh h'r'"
        applyjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    fromnext
  } se (2l ysjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  note"."
  ultimately ( effect_raiseE
     res_thm
     ( lv va
    apply simp
    applyjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    applyshows
     induct arbitrary
    apply fastforce
    done
next
  case (2 l ys r)
  thus ?case
    unfolding
    byapply( effect_ifEeffect_raiseE
next
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   case
    unfolding    "h = h'java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
byelim) auto
qed

lemma:
assumes "effect (res_mem l xs) hauto add: res_mem_no_heap)
   "h = h'"
using
applyl resolve2_no_heap:
unfolding res_mem.simps
apply (elim effect_raiseE)
apply auto
apply (elim effect_ifE effect_bindE effect_raiseE effect_returnE "effect (resolve2 l xsh '
apply auto
doneunfolding.simps

lemma resolve1_no_heap:
assumes "effect (resolve1 l xs ys) h h' r"
  showsh  '"
using elim) auto
apply (inductjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
.
applyusingassms
( simp )
by (elim effect_raiseE) auto

lemma resolve2_no_heap:
assumes "effect (resolve2 l xs ys) h h' r"
  shows "h = h'"
usingassms
apply (nduct ys arbitrary: resolve2.induct
unfolding
apply      ( effect_bindEeffect_ifE)
apply (auto simp(uto add resolve2_no_heap
bycase


     res_thmsimps
  assumes "effect (res_thm' l xs ys) h h' r"
  shows "h = h'"
  using assms
proof (inductby elimeffect_raiseEauto
  case (1 l x xs y ys r)
  thus ?thesis (3l v va
    unfolding'.simps
     (elim effect_bindE effect_returnE)
  (auto simp add  effect_raiseE) auto
next
  case java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  thus ys ys
    unfolding   assumes xs: "correctClause \<and> sorted xs \<and> distinct xs"
    by -
next res_thm[ res_thmys?
  case (3 l v va r)
 ?case
    unfolding res_thm'.simps
    by ( effect_raiseE)auto
qed


lemma res_thm'_Inv2:
  assumes res_thm: "effect (res_thm' l xs ys) h h' (auto add: remove1_eq_remove)
  assumes rule)
  assumes ysapply simp_all
assumes"correctClause r \ sorted xs \ distinct xs"
  showscorrectClause \<and> sorted rcl \<and> distinct rcl"
proof
  from'_nv[ res_thm] xsys show ?thesis
    apply (
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    apply (auto simp where
prefer
    apply            ( cof \<Rightarrow> raise STR ''Clause not found''
     simp_all
    apply (insert compl_exists       "
    apply 
    apply (rule res_thm2 Clausearray
    apply simp_all
one
qed

  ( if l = raiseSTR '' literal''

definition get_clause { clj
where
  "get_clause ' l cli clj
       }"
           (case cjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
                    |
       }"


 res_thm2 :: "Clauseoption \ (Lit * ClauseId) \ Clause \ Clause Heap"
where
  "res_thm2 a (l, j) cli =
  ( if l = 0 then raise STR ''Illegal literal''
    else
     do { clj \<leftarrow> get_clause a j; \<leftarrow> foldM (res_thm2 a) rs cli;
         res_thm"
     })"

primrecdoProofStep2( =  }
  | "doProofStep2Root ) rcs = do { Array cid Some (sortclause))a return # rcs"
where
  "foldM f [] s = return s"
  | "foldM f (x#xs) s = f x s \ foldM f xs"

fundoProofStep2 Clause arrayjava.lang.StringIndexOutOfBoundsException: Index 122 out of bounds for length 122
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  "doProofStep2 a (Conflict saveTo (i, rs)) rcs =
  do
  do
     result <>Array n None
     Array.     rcs
     return rcs
  }"
ofStep2a Delete) rcs= do Array cid  a; return }"
 doProofStep2cid=  .  Some)  ( # )}java.lang.StringIndexOutOfBoundsException: Index 119 out of bounds for length 119
"doProofStep2 a (Xstep cid1 }java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
"doProofStep2 a (ProofDone b) rcs = raise STR ''MiniSatChecked.doProofStep: ProofDone constructor found.''"

definition checker :: "nat \ ProofStep list \ nat \ Clause list Heap"

  "checker n p i "x=" "effect
   {
     a \<leftarrow> Array.new n None;
     rcs \<leftarrow> foldM (doProofStep2 a) p [];using unfolding effect_defby (auto split: option.splits
  assumes"effect( a (l, ) h h'rs
if  []  return 
                else raise STR ''No empty clause'')
  }"

lemma effect_case_option "h =h
  assumes "effect (case x of ( elim: effect_raiseE)

         | y whereletrsmergel )(removeclj
  using assms effect_def (auto:option)

lemma res_thm2_Inv:
  assumesassume" =Some = . h a ! " j < Array.h'ajava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
  assumes correct_a       correctArray_defby( intro:)
assumes"correctClause r cli \ sorted cli \ distinct cli"
  shows ='\correctClauserrs\ sorted rs \ distinct rs"
-
  from res_thm have l_not_zero: "l \ 0"
    by (auto       (compl l \<in> set cli \<and> l \<in> set clj
  {
    apply ( intro!: correctClause_resolvants
    letrs"merge (remove lcli) (emove(compl )clj"
    let ?rs' (auto intro!: )
assume " h'"" clj =Arrayget 'a!j "  Arraylength h' ajava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
    withwith havecljcorrectClause
 correctArray_def intro)
    with clj l_not_zero correct_cli
    have "(l \ set cli \ compl l \ set clj
      <longrightarrow> correctClause r ?rs \<and> sorted ?rs \<and> distinct ?rs) \<and>
      (compl l \<in> set cli \<and> l \<in> set clj
      \<longrightarrow> correctClause r ?rs' \<and> sorted ?rs' \<and> distinct ?rs')"
      apply (auto intro!: java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 3
apply(insert [ofl)
      by (auto intro!: correctClause_resolvants)
  }
  {
    fix v cljby( effect_bindE effect_nthE  effect_case_option auto
    lemma:
with havecljrclj
      unfolding by ( intro )
    assume effect )h'"
    from res_thm'_no_heap[OF this] res_thm'_Inv2[OF this l_not_zero "h =h'
haveh
  }
   assms ?thesis
    unfolding res_thm2 foldMsimps
  effect_ifE effect_raiseE effect_case_option
qed

lemma foldM_Inv2 ( x xs)
  assumes "effect (foldM (res_thm2 a) rs cli) h h' rcl"
  assumes correct_a: "correctArray r a h"
assumes"correctClause r cli\
      with haveres_thm2'"(res_thm2 (java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
using assms
proof (induct rs arbitrary: h h' cli)
  case Nil thus ?case
    unfolding.simps
    by ( effect_returnE
next
  case (Cons x xs)
  {
    fix h1 ret
    obtain l j where x_is: "x = (l, j)" by fastforcefromstep.hyps [OF correct_a rethave
assumeres_thm2 (res_thm2 a x cli) hh1"
    with  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    note step =     by elimeffect_bindE
    
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
assume" (foldM (res_thm2 a xs ret h1 h' rcl"
    fromassumes"correctArray rcs h"
    "h = h' \ correctClause r rcl \ sorted rcl \ distinct rcl" by auto
  }
  with Cons show ?case
    unfolding:)
by effect_bindE
qed


lemma step_correct2:
  assumes effect: "effect (doProofStep2 a step rcs) h h' res"
  assumes correctArray: "correctArray rcs a h"
  shows "correctArray res a h'"
proof (casesby( intro: correctArray_update
case(asaveTo rcs
with correctArray
  show
         ( simp elim ffect_bindE effect_returnE
apply simp !:  effect_nthE
    apply( elim  effect_case_option
       effect_updE
applyfrule)
    apply assumption
    apply (simp( elim  effect_returnE
    apply ( x="y" in)
a (rule[where=]
    by (auto auto: correctClause_def
next
  case (2 a cid rcs)
  with effect    ?thesisauto: effect_raiseE
  show
    by (auto simp  case5
     dest: array_ran_upd_array_None
next
  case (3 a  c rcs
  with effect correctArray
  showjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    apply (auto elim!: effect_bindE "correctArray res h'
    apply (auto simp induct arbitrary h )
    apply (auto intro: correctClause_mono)
    by (auto simp: correctClause_def)
next
  case 4
   effect
by elim)
next
  case5
  with effect effect_bindE effect_ifE  effect_newE
  show ?thesis by (auto elim: effect_raiseEauto
qed
  

theorem fold_steps_correct:
  assumes effect (oProofStep2steps h'"
  assumes "correctArray rcs a h"
  showscorrectArray '
using assms
by (induct arbitrary: rcs h h' res)
 (auto elim!: effect_bindE effect_returnE dest:step_correct2)

theorem checker_soundness with Lists as Array
  assumessubsection\<open>List specific definitions\<close>
  shows on :: "' option list \ 'a set"
 assms checker_def
apply (elim effect_bindE effect_nthE effect_ifE effect_returnE effect_raiseE effect_newE)
prefer simp
apply auto
apply (druleunfolding by (drule, )
apply (simplist_ran_update_Some:
apply  " \ list_ran (xs[i := (Some b)]) \ cl \ list_ran xs \ cl = b"
apply (simp add:correctArray_def)
 (drule)
byhaveset  b)\<subseteq> insert (Some b) (set xs)"

section \<open>Functional version with Lists as Array\<close>

subsection assms" insert (Some b) (set xs)"

definition list_ranu list_ran_def java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
where
  "list_ran xs = e Some set xs }"

lemma" \ list_ran (xs[i := None]) \ cl \ list_ran xs"
unfolding list_ran_def by  assumeassmscl

lemma list_ran_update_Some:
       ( onlyset_update_subset_insert
proof java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
  assume assms: "cl \ list_ran (xs[i := (Some b)])"
  have "set (xs[i := Some b]) \ insert (Some b) (set xs)"
    by (simp only: set_update_subset_insert)
  with assms have "Some s =
    unfolding list_ran_def by fastforce
  thus ?thesis
    unfolding list_ran_def by auto
qed

lemmalist_ran_update_None
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
proof -
   assmsjava.lang.NullPointerException
  have "set (xs[i Someclj res_thm' l cli clj
    by (simp only: set_update_subset_insert)
  with assms show?
    unfolding list_ran_def
qed

 correctList Clause\<Rightarrow> Clause option list \<Rightarrow> bool"
where
  "correctList rootcls xs =
(<forall>cl \<in> list_ran xs. correctClause rootcls cl \<and> sorted cl \<and> distinct cl)"

subsection

  :option
where
  lres_thmj    j  . )then  j)of
  None \<Rightarrow> raise STR ''MiniSatChecked.res_thm: No resolvant clause in thms array for Conflict step.''
  | Somereturn[saveTo resultrcl
 ) else raise                   


fun |" (Rootcid clause) (, rcl)= (xs[cid= (sort clause] remdupssort)) # rcl)"
where
  "ldoProofStep (Conflict saveTo (i, rs)) (xs, rcl) =
casexs
       None \<Rightarrow> raise STR ''MiniSatChecked.doProofStep: No starting clause in thms array for Conflict step.''
     | Some cli \<Rightarrow> do {
                      result \<leftarrow> foldM (lres_thm xs) rs cli ;
                      return ((xs[saveTo:=Some result]), rcl)
                   })"
"ldoProofStep (Delete cid) (xs, rcl) = return (xs[cid:=None], rcl)"
"ldoProofStep (Root cid clause) (xs, rcl) = return do {
"ldoProofStep \ foldM (ldoProofStep) p ([], []);
" (ProofDone )(, rcl) STR '.:constructor

definition lchecker raise ''No clause
where
  "lchecker n p i =
  do {
     rcs \<leftarrow> foldM (ldoProofStep) p ([], []);
     (if (fst rcs !  (caserbt_lookup t j  
                else raise 'Noemptyclause'java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  }"


section \<open>Functional version with RedBlackTrees\<close>

tres_thmClauseId) RBT_Impl \<Rightarrow> Lit \<times> ClauseId \<Rightarrow> Clause \<Rightarrow> Clause Heap"
where
  " t (l,)cli=
  (case (rbt_lookup \<Rightarrow> raise STR ''MiniSatChecked.doProofStep: No starting clause in thms array for Conflict step.''
     None
   | Some clj \<Rightarrow> res_thm' l cli clj)"

fun tdoProofStep :: " ProofStep \ ((ClauseId, Clause) RBT_Impl.rbt * Clause list) \ ((ClauseId, Clause) RBT_Impl.rbt * Clause list) Heap"
where
  "tdoProofStep (Conflict saveTo (i, })"
     case(bt_lookup java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30
       None \<Rightarrow> raise STR ''MiniSatChecked.doProofStep: No starting clause in thms array for Conflict step.''  ()=raiseMiniSatCheckedXstep'"
     | Some cli \<Rightarrow> do {
                      result
                      return ((rbt_insert saveTo result t), rcljava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
                   })"
"tdoProofStep (Delete cid) (t, rcl) = return ((rbt_delete cid if ( (fst rcs)i [] then return ( rcs)
"tdoProofStep (Root cid clause) (t, rcl) = return (rbt_insert cid (sort clause) t, (remdups(sort clause)) # rcl) }java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
| tdoProofStep ),rclSTRMiniSatCheckedXstep'"
"tdoProofStep (ProofDone b) (t


where
  "tchecker n p i =
  do {
     rcs \<leftarrow> foldM (tdoProofStep) p (RBT_Impl.Empty, []);
     (if (rbt_lookup (fst rcs) i) = Some [] then return (snd rcs) 
                else raise STR ''No empty clause'')
  }"

export_code checker tchecker lchecker checking SML

end

100%


¤ 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.0.43Bemerkung:  ¤

*Bot Zugriff






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 ist noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge