src/HOL/ex/svc_test.thy
changeset 58956 a816aa3ff391
parent 58889 5b7a9633cfa8
equal deleted inserted replaced
58955:1694bad18568 58956:a816aa3ff391
     9 text {*
     9 text {*
    10   @{text "blast"}'s runtime for this type of problem appears to be exponential
    10   @{text "blast"}'s runtime for this type of problem appears to be exponential
    11   in its length, though @{text "fast"} manages.
    11   in its length, though @{text "fast"} manages.
    12 *}
    12 *}
    13 lemma "P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P"
    13 lemma "P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P=P"
    14   by (tactic {* svc_tac 1 *})
    14   by svc
    15 
    15 
    16 
    16 
    17 subsection {* Some big tautologies supplied by John Harrison *}
    17 subsection {* Some big tautologies supplied by John Harrison *}
    18 
    18 
    19 text {*
    19 text {*
    37    (~v4 | v7 | v2) &
    37    (~v4 | v7 | v2) &
    38    (~v12 | ~v3 | v8) &
    38    (~v12 | ~v3 | v8) &
    39    (~v4 | v5 | v6) &
    39    (~v4 | v5 | v6) &
    40    (~v7 | ~v8 | v9) &
    40    (~v7 | ~v8 | v9) &
    41    (~v10 | ~v11 | v12))"
    41    (~v10 | ~v11 | v12))"
    42   by (tactic {* svc_tac 1 *})
    42   by svc
    43 
    43 
    44 lemma dk17_be:
    44 lemma dk17_be:
    45   "(GE17 <-> ~IN4 & ~IN3 & ~IN2 & ~IN1) &
    45   "(GE17 <-> ~IN4 & ~IN3 & ~IN2 & ~IN1) &
    46     (GE0 <-> GE17 & ~IN5) &
    46     (GE0 <-> GE17 & ~IN5) &
    47     (GE22 <-> ~IN9 & ~IN7 & ~IN6 & IN0) &
    47     (GE22 <-> ~IN9 & ~IN7 & ~IN6 & IN0) &
   115         (OUT4 <-> WRES11 & IN9 | WRES12 & IN8) &
   115         (OUT4 <-> WRES11 & IN9 | WRES12 & IN8) &
   116         (OUT3 <-> WRES8 & IN9 & ~IN8 | WRES11 & ~IN9 | WRES12 & ~IN8) &
   116         (OUT3 <-> WRES8 & IN9 & ~IN8 | WRES11 & ~IN9 | WRES12 & ~IN8) &
   117         (OUT2 <-> WRES8 & ~IN9 | WRES10 & IN8) &
   117         (OUT2 <-> WRES8 & ~IN9 | WRES10 & IN8) &
   118         (OUT1 <-> WRES7 & IN8) &
   118         (OUT1 <-> WRES7 & IN8) &
   119         (OUT0 <-> WRES7 & ~IN8)"
   119         (OUT0 <-> WRES7 & ~IN8)"
   120   by (tactic {* svc_tac 1 *})
   120   by svc
   121 
   121 
   122 text {* @{text "fast"} only takes a couple of seconds. *}
   122 text {* @{text "fast"} only takes a couple of seconds. *}
   123 
   123 
   124 lemma sqn_be: "(GE0 <-> IN6 & IN1 | ~IN6 & ~IN1) &
   124 lemma sqn_be: "(GE0 <-> IN6 & IN1 | ~IN6 & ~IN1) &
   125    (GE8 <-> ~IN3 & ~IN1) &
   125    (GE8 <-> ~IN3 & ~IN1) &
   219         WRES9 & ~WRES1 |
   219         WRES9 & ~WRES1 |
   220         WRES12 & ~WRES10 |
   220         WRES12 & ~WRES10 |
   221         WRES16 & WRES7 |
   221         WRES16 & WRES7 |
   222         WRES18 & WRES0 & ~IN5 |
   222         WRES18 & WRES0 & ~IN5 |
   223         WRES19)"
   223         WRES19)"
   224   by (tactic {* svc_tac 1 *})
   224   by svc
   225 
   225 
   226 
   226 
   227 subsection {* Linear arithmetic *}
   227 subsection {* Linear arithmetic *}
   228 
   228 
   229 lemma "x ~= 14 & x ~= 13 & x ~= 12 & x ~= 11 & x ~= 10 & x ~= 9 &
   229 lemma "x ~= 14 & x ~= 13 & x ~= 12 & x ~= 11 & x ~= 10 & x ~= 9 &
   230       x ~= 8 & x ~= 7 & x ~= 6 & x ~= 5 & x ~= 4 & x ~= 3 &
   230       x ~= 8 & x ~= 7 & x ~= 6 & x ~= 5 & x ~= 4 & x ~= 3 &
   231       x ~= 2 & x ~= 1 & 0 < x & x < 16 --> 15 = (x::int)"
   231       x ~= 2 & x ~= 1 & 0 < x & x < 16 --> 15 = (x::int)"
   232   by (tactic {* svc_tac 1 *})
   232   by svc
   233 
   233 
   234 text {*merely to test polarity handling in the presence of biconditionals*}
   234 text {*merely to test polarity handling in the presence of biconditionals*}
   235 lemma "(x < (y::int)) = (x+1 <= y)"
   235 lemma "(x < (y::int)) = (x+1 <= y)"
   236   by (tactic {* svc_tac 1 *})
   236   by svc
   237 
   237 
   238 
   238 
   239 subsection {* Natural number examples requiring implicit "non-negative" assumptions *}
   239 subsection {* Natural number examples requiring implicit "non-negative" assumptions *}
   240 
   240 
   241 lemma "(3::nat)*a <= 2 + 4*b + 6*c  & 11 <= 2*a + b + 2*c &
   241 lemma "(3::nat)*a <= 2 + 4*b + 6*c  & 11 <= 2*a + b + 2*c &
   242       a + 3*b <= 5 + 2*c  --> 2 + 3*b <= 2*a + 6*c"
   242       a + 3*b <= 5 + 2*c  --> 2 + 3*b <= 2*a + 6*c"
   243   by (tactic {* svc_tac 1 *})
   243   by svc
   244 
   244 
   245 lemma "(n::nat) < 2 ==> (n = 0) | (n = 1)"
   245 lemma "(n::nat) < 2 ==> (n = 0) | (n = 1)"
   246   by (tactic {* svc_tac 1 *})
   246   by svc
   247 
   247 
   248 end
   248 end