Algorithm Search⌘K

Techniqueadvanced

Static learning

Also called SOCRATES learning, implication learning.

Precomputes indirect implications of each signal value by contraposition, as in SOCRATES, so ATPG and equivalence checking find conflicts earlier.

Static learning is a step that a test generator runs once, before it looks at any fault. For each line of the circuit and each value 0 and 1, it sets the value, makes all the simple implications, and turns what it finds around by contraposition: if a=0a = 0 implies f=0f = 0, then f=1f = 1 implies a=1a = 1. The turned-around implications are often ones that the simple one-gate rules can never find, so the tool stores them and uses them in every later implication step. Schulz, Trischler and Sarfert introduced it in the SOCRATES test generator (1988), which was built on FAN. The method is sound, which this page proves: every stored implication holds for every input vector. It is not complete: some implications need case splits, which is what recursive learning adds.

In plain words

When you set one signal of a circuit, simple rules tell you what other signals must be. Those rules move easily forward through gates but often get stuck going backward. For example, knowing that an OR gate outputs 1 does not tell you which input is 1.

Static learning works around this with an old rule of logic. If "A is true" always makes "B true", then "B false" always makes "A false". The tool tries every signal at 0 and at 1 before the real work starts, writes down every new fact it gets this way, and keeps the list. Later, when the test generator sets values, it reads the list and sees conflicts sooner, so it makes fewer wrong guesses.

When it applies

  • The circuit is combinational, or the combinational part of a scan design, with stems and fanout branches as on the PODEM page.
  • An implication engine exists, as in PODEM, FAN or the D-algorithm: from a set of values, it applies one-gate rules until nothing changes, or it finds a line that needs both values.
  • There is time to run the engine twice per line before the search, and memory to store the learned implications.
  • The search will meet the same kinds of situation many times, as in test generation for a long fault list, so a one-time cost pays off.

The template

Write (a,v)⇒(b,w)(a, v) \Rightarrow (b, w) when every input vector that gives line aa the value vv also gives line bb the value ww. A direct implication comes from one gate: known inputs fix the output, an AND output at 1 sets every input to 1, an AND output at 0 with all inputs but one at 1 sets the last one to 0, and a stem and its branches have one value. IMPLY(S)(S) applies the direct implications and the stored learned implications to a set of values until nothing changes. It returns CONFLICT when a line gets both values.

  1. STATIC-LEARN(circuit)
  2. 1learned ← empty; constants ← empty
  3. 2repeat
  4. 3for each line a and each value v in {0, 1}
  5. 4S ← IMPLY({(a, v)})
  6. 5if S is CONFLICT then add (a, ¬v) to constants; continue
  7. 6for each (b, w) in S with b ≠ a
  8. 7if (b, ¬w) ⇒ (a, ¬v) passes the usefulness test then
  9. 8add (b, ¬w) ⇒ (a, ¬v) to learned
  10. 9until a whole pass adds nothing
  11. 10return learned, constants

The holes are the implication engine and the usefulness test at line L7. SOCRATES runs one pass. Later tools repeat the passes, because a learned implication can make IMPLY find more on the next pass.

The usefulness test. Most contrapositives repeat what the direct rules already know. From a=0a = 0 at the input of an AND gate dd, IMPLY gives d=0d = 0, and the contrapositive d=1⇒a=1d = 1 \Rightarrow a = 1 is a direct implication. SOCRATES keeps a contrapositive only when it adds something. The idea of its test is to look at the gate that drives bb. If ww is the value that the gate gives when all its inputs are at their non-controlling values, for example 0 at an OR output or 1 at an AND output, then ¬w\lnot w is the value that the gate cannot pass back to its inputs, so the direct rules cannot find anything from (b,¬w)(b, \lnot w), and the contrapositive is worth storing. The paper gives the exact conditions.

Why it is sound. Every value in SS at line L4 holds in every input vector with a=va = v. Each direct implication follows from the function of one gate, so it holds in every vector where its premises hold. By induction on the order in which values enter SS, every value of SS holds in every vector with a=va = v, as long as every learned implication used by IMPLY is sound too. The learned implications are sound by induction on the order in which they are added, since each one comes from a sound IMPLY run by the following step.

  • Contraposition. If (a,v)⇒(b,w)(a, v) \Rightarrow (b, w), then (b,¬w)⇒(a,¬v)(b, \lnot w) \Rightarrow (a, \lnot v). Take any input vector with b=¬wb = \lnot w. If it gave a=va = v, it would give b=wb = w by the first implication, which is false. Lines have only the values 0 and 1, so the vector gives a=¬va = \lnot v.
  • Constants. If IMPLY({(a,v)})(\{(a, v)\}) returns CONFLICT, then no input vector gives a=va = v, since such a vector would give some line both values. So a=¬va = \lnot v in every vector, and aa is a constant line. The fault aa stuck-at ¬v\lnot v is then redundant, because no vector can activate it.

So every learned implication and every constant holds for all input vectors of the circuit. In a test generator, a situation SS is a set of values that the search wants, and an implication that holds for every vector also holds for every vector that agrees with SS. Using the learned implications therefore never removes a test that exists. They only find conflicts earlier.

What it misses. Static learning is not complete. Take inputs aa and bb, the gates x=a⊕bx = a \oplus b and y=a⊕by = a \oplus b, and the output z=x⊕yz = x \oplus y. The line zz is the constant 0. But setting any one line to any value implies nothing except the values of its stem and branches, because an XOR gate with one input unknown has an unknown output, and an XOR output tells nothing about one input. So static learning learns no implication and finds no constant, and the fault zz stuck-at 0 looks testable. Recursive learning at depth 2 shows that z=1z = 1 has no consistent input vector, as its page explains. In general, a contrapositive can only be as good as the forward run it comes from, and the forward run never splits cases.

Cost. Each IMPLY run takes time linear in the number of lines, gate inputs and stored implications, so one pass takes O(L(L+P+E))O(L (L + P + E)) time for LL lines, PP gate input pins and EE learned implications. The learned list can hold up to 4L24L^2 implications in principle. In practice the usefulness test keeps it much smaller.

Example. Take inputs aa, bb and cc, the AND gates d=abd = a b and e=ace = a c, and the output f=d+ef = d + e. The input aa fans out to dd and ee.

set IMPLY gives contrapositive kept?
a=0a = 0 d=0d = 0, e=0e = 0, f=0f = 0 f=1⇒a=1f = 1 \Rightarrow a = 1 yes: f=0f = 0 is the value of an OR with all inputs at 0
a=0a = 0 d=0d = 0 d=1⇒a=1d = 1 \Rightarrow a = 1 no: direct
b=0b = 0 d=0d = 0 d=1⇒b=1d = 1 \Rightarrow b = 1 no: direct
d=1d = 1 a=1a = 1, b=1b = 1, f=1f = 1 f=0⇒d=0f = 0 \Rightarrow d = 0 no: direct
f=0f = 0 d=0d = 0, e=0e = 0 d=1⇒f=1d = 1 \Rightarrow f = 1 no: direct

The only new implication is f=1⇒a=1f = 1 \Rightarrow a = 1. It is true, since f=a(b+c)f = a (b + c), and the direct rules cannot find it: an OR at 1 with two unknown inputs implies nothing. Now say the search sets f=1f = 1 to propagate a fault effect and later tries a=0a = 0. Without learning, the conflict shows only when dd and ee are evaluated after more decisions. With the learned implication, f=1f = 1 sets a=1a = 1 at once, and the search never tries a=0a = 0.

Classic examples

  • SOCRATES. The test generator of Schulz, Trischler and Sarfert ran static learning before test generation, together with improved multiple backtrace and unique sensitization. It cut the number of backtracks on the ISCAS benchmark circuits a lot. These are measured results of the paper.
  • Redundancy identification. A conflict at line L5 proves at once that a line is constant, so the faults that need the other value are redundant. Learned implications also help the search prove other faults redundant.
  • Equivalence checking. In equivalence checking, implications learned between the lines of two circuits show lines that are equal or complementary, which splits the problem into small parts.
  • SAT solving. Failed literal probing in SAT preprocessing is the same idea on clauses: set a literal, propagate, and learn its negation if a conflict appears. In clause form contraposition is free, because a two-literal clause ¬a∨b\lnot a \lor b gives both a⇒ba \Rightarrow b and ¬b⇒¬a\lnot b \Rightarrow \lnot a, as in the implication graph of 2-SAT.

Variations

  • Several passes. Repeating the loop until it adds nothing finds implications that need an earlier learned one.
  • Dynamic learning. Schulz and Auth (1989) also learn during the search, from the current situation and not only from single values, and use it to prove faults redundant.
  • Recursive learning. Recursive learning splits each unjustified gate into cases and keeps what all cases share. With enough depth it finds every necessary value, which static learning cannot.
  • Sequential circuits. The same idea works across clock cycles in time-frame expansion, where implications can relate a line in one frame to a line in another.
  • Cheaper learning. Later work limits learning to fanout stems or to gates near reconvergence, where most useful implications come from.

Pitfalls

  • Applying good-circuit facts to the faulty circuit. The learned implications hold for the fault-free circuit. In a five-valued test generator with D and D', they apply to the good-circuit part of each value. The faulty circuit computes a different function near the fault.
  • Keeping everything. Without a usefulness test the list grows close to quadratic in the circuit size and slows every implication step, while most entries add nothing.
  • Reading an empty result as a proof. If static learning finds no constant, the line can still be constant, as the XOR example shows.
  • Changing the circuit. The learned list belongs to one netlist. After any change, such as inserting a test point, it must be learned again.

Exercises

  1. In the example, add the gate g=b+cg = b + c. Which new implications does static learning find from gg?
  2. Build f=a(b+c)f = a (b + c) as one AND gate of aa and g=b+cg = b + c, without fanout. Show that f=1⇒a=1f = 1 \Rightarrow a = 1 is now a direct implication, so the usefulness test rejects it.
  3. Give a circuit with a constant line that static learning finds by a conflict at line L5.

References

  1. M. H. Schulz, E. Trischler and T. M. Sarfert, SOCRATES, a highly efficient automatic test pattern generation system, IEEE Transactions on Computer-Aided Design 7(1), 126 to 137, 1988, the section on static learning, with the learning procedure, the contrapositive law and the test that keeps only useful implications
  2. M. H. Schulz and E. Auth, Improved deterministic test pattern generation with applications to redundancy identification, IEEE Transactions on Computer-Aided Design 8(7), 811 to 816, 1989, the improved implication procedure (dynamic learning during the search) and its use to prove faults redundant
  3. W. Kunz and D. K. Pradhan, Recursive learning, a new implication technique for efficient solutions to CAD problems (test, verification and optimization), IEEE Transactions on Computer-Aided Design 13(9), 1143 to 1158, 1994, the comparison of static learning with recursive learning, and examples of implications that static learning misses
  4. Michael L. Bushnell and Vishwani D. Agrawal, Essentials of Electronic Testing for Digital, Memory and Mixed-Signal VLSI Circuits, Kluwer, 2000, the chapter Combinational Circuit Test Generation (SOCRATES and learning)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW3 standard
  • five exercises