07.01.2013 Views

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

328 Levi Lúcio and Marko Samer<br />

[Pau94, NPW02], a generic theorem prover which supports proof tactics 3 .Set<br />

operations, predicate logic, and Cartesian products <strong>in</strong> Z can be directly translated<br />

<strong>in</strong>to Isabelle. The representation of schemas <strong>in</strong> Isabelle can be done <strong>in</strong><br />

several ways; Helke et al. [HNS97] chose a predicate representation (cf. Kolyang<br />

et al. [KSW96]). For <strong>in</strong>stance, the schema Counter resp. Increment <strong>in</strong> Sec. 12.2.1<br />

is translated <strong>in</strong>to the predicate Counter resp. Increment as shown below, where<br />

λ identifies the free variables:<br />

Counter ≡ λ ctr. [ ctr : N | 0 ≤ ctr < 4]<br />

Increment ≡ λ(ctr, ctr ′ ). [ Counter(ctr) ∧ Counter(ctr ′ ) |<br />

((ctr < 3) ∧ (ctr ′ = ctr +1))∨ ((ctr =3)∧ (ctr ′ =0))]<br />

With this encod<strong>in</strong>g of Z specifications, Isabelle can be applied to construct<br />

test cases <strong>in</strong> such a way as described <strong>in</strong> the follow<strong>in</strong>g. The approach of Helke<br />

et al. [HNS97] is based on disjunctive normal form partition<strong>in</strong>g [DF93]. That<br />

is, the predicate part of a schema is transformed <strong>in</strong>to disjunctive normal form,<br />

where the disjuncts are pairwise disjo<strong>in</strong>t (i.e., the disjunction is equivalent to<br />

the exclusive or of its disjuncts). Each of the result<strong>in</strong>g disjuncts is assumed to<br />

def<strong>in</strong>e a equivalence class concern<strong>in</strong>g the test behavior, and can therefore be<br />

<strong>in</strong>terpreted as a test case. The pairwise disjo<strong>in</strong>tness allows us to treat each test<br />

case entirely <strong>in</strong>dependently. To obta<strong>in</strong> disjunctive normal form, the usual logical<br />

transformation rules can be applied. To obta<strong>in</strong> pairwise disjo<strong>in</strong>tness, however,<br />

disjunction, implication, and bi-implication have to be transformed accord<strong>in</strong>g<br />

to:<br />

A ∨ B ≡ (A ∧¬B) ∨ (¬A ∧ B) ∨ (A ∧ B) (12.1)<br />

A ⇒ B ≡ ¬A∨ (A ∧ B) (12.2)<br />

A ⇔ B ≡ (A ∧ B) ∨ (¬A ∧¬B) (12.3)<br />

The schemas of our example above are already <strong>in</strong> such a normal form (cf.<br />

Sec. 12.2.1). The schema Counter consists of only one disjunct <strong>in</strong> the predicate<br />

part and is therefore trivially <strong>in</strong> disjunctive normal form. Furthermore, the<br />

schema Increment is also <strong>in</strong> disjunctive normal form. In this simple example,<br />

it is easy to see that the disjuncts are pairwise disjo<strong>in</strong>t because ctr < 3and<br />

ctr = 3 are mutually exclusive. Nevertheless, for demonstration purposes, we ignore<br />

our knowledge of the disjo<strong>in</strong>tness of the disjuncts and apply transformation<br />

rule (12.1) to the schema Increment. Thus, we obta<strong>in</strong> the equivalent schema:<br />

3 Proof tactics are “subrout<strong>in</strong>es” written <strong>in</strong> a metalanguage for the purpose of support<strong>in</strong>g<br />

the proof search procedure. For <strong>in</strong>stance, they can be used to transform<br />

proofs or to justify proof steps by autonomously perform<strong>in</strong>g detailed proof steps.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!