Data structureadvanced
Taylor expansion diagram
Also called TED.
Ciesielski, Kalla and Askar's canonical graph of a polynomial over word-level variables built by Taylor expansion, used to verify arithmetic datapaths.
- Time
- O(f g D) expected addO(f D) evaluateO(D) expected mk
- Space
- O(f D) nodes
- Where
- D = the largest degree of one variable; f = the number of nodes of the first argument; g = the number of nodes of the second argument
- Model
- Word RAM
- Properties
- not concurrentnot externalpersistent
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Maciej Ciesielski, Priyank Kalla, 2001
A Taylor expansion diagram (TED) is a canonical graph of a multivariate polynomial. Ciesielski, Kalla and their coauthors introduced it in 2001 to compare arithmetic datapaths at the word level. Each variable stands for a whole data word and takes integer or real values, not bits. For the top variable in a fixed order, a node expands its polynomial in the Taylor series at :
where the derivatives are by and the coefficients are polynomials in the later variables. A polynomial has a finite series, so the node has one child per power . With the rules "drop a node that does not depend on its variable" and "merge equal nodes", the diagram is canonical: two expressions, such as and , give the same node exactly when they are the same polynomial. A TED of a 0-1 variable needs only the powers 0 and 1, since , and then the node is the moment node of a binary moment diagram. The TED carries that idea to word variables.
In plain words
Write a polynomial in a fixed order of its variables. Take the first variable, say , and group the terms by the power of : the terms without , the terms with , those with , and so on. Each group, with its power of taken out, is a smaller polynomial in the other variables. Do the same for each of them with the next variable, and so on until only numbers are left.
Draw this as a graph. A node for has an arrow to each group. Equal groups are stored only once, and a variable that does not occur is skipped. Then every polynomial has exactly one graph. To test whether two circuits compute the same polynomial, build both graphs and compare the two top nodes.
The abstract type
The variables are in this order, and the coefficients are rational numbers. A node stands for a polynomial .
| operation | result |
|---|---|
| CONST | the constant polynomial |
| MK | the polynomial |
| ADD | |
| MUL | |
| EVALUATE | the value of at the point |
| BUILD | the node of an expression made of variables, numbers, , , and powers |
| EQUAL | whether , by comparing ids |
For a polynomial in there are unique polynomials in , with unless , such that . They are the Taylor coefficients: at . Division by needs a field of characteristic 0, such as or .
Representation
A sink stores one rational number . An inner node stores the level and children on later levels, where is the node of the -th Taylor coefficient. A unique table maps each key to its node, and MK keeps three rules:
- Trailing zeros. A last child that is the sink 0 is dropped, since adds nothing.
- No dependence. If only is left, MK returns , since does not depend on .
- Merging. If the key is stored, MK returns the stored node.
So every inner node has at least two children and a nonzero last child. Unfolded, a TED lists the monomials of : the path that takes child at each tested variable ends at the coefficient of , and a skipped variable has power 0.
Operations
For a node and a level at most the level of , let be if , and if is on a later level.
MK(v, c_0, ..., c_d)- 1
while d ≥ 1 and c_d is the sink 0 do d ← d − 1 ▷ trailing zeros - 2
if d = 0 then return c_0 ▷ no dependence on x_v - 3
if U holds (v, c_0, ..., c_d) then return it ▷ merging - 4
otherwise make a new node u, store U[v, c_0, ..., c_d] ← u, and return u ADD(f, g) ▷ ADD(0, g) = g, ADD(f, 0) = f; results are cached under {f, g}- 5
if f and g are sinks then return CONST(q_f + q_g) - 6
v ← min(level(f), level(g)); a ← coef(f, v); b ← coef(g, v); pad the shorter with 0; return MK(v, ADD(a_k, b_k) for each k) MUL(f, g) ▷ 0 and 1 are shortcuts; results are cached under {f, g}- 7
if f and g are sinks then return CONST(q_f · q_g) - 8
v, a, b as in ADD; for k ← 0 to d_a + d_b do c_k ← the ADD of MUL(a_i, b_j) over all i + j = k - 9
return MK(v, c_0, ..., c_{d_a + d_b}) EVALUATE(u, p) ▷ one pass over the nodes reachable from u, children first- 10
val[w] ← q for a sink (n + 1, q); val[w] ← Σ_k val[c_k] · p_v^k by Horner's rule for w = (v, c_0, ..., c_d); return val[u] BUILD(e)- 11
a variable x gives MK(x, 0, 1), a number q gives CONST(q); +, −, × and powers recurse with ADD, ADD and MUL by −1, and MUL
ADD uses that the Taylor coefficients of a sum are the sums of the coefficients. MUL multiplies two polynomials in whose coefficients are polynomials in the later variables:
Example
The square of a sum. Take the order and . BUILD gives the node of , namely , and MUL of it with itself. Line L8 takes , for both, and computes
| Taylor coefficient of by | node | ||
|---|---|---|---|
| 0 | |||
| 1 | at : | ||
| 2 | the sink 1 |
The root is : 3 inner nodes and the sinks 0, 1 and 2, so 6 nodes. BUILD of the other form goes through other calls and returns the same root id.
Rational coefficients. With one variable, and both give the node . The children are , and .
A datapath rewrite. With the order , the designs and give the same node , where is . A bit-level check of the two would compare circuits with different multipliers.
Measured sizes, with the code of this page:
| polynomial | inner nodes | all nodes | monomials |
|---|---|---|---|
| , | 4, 6, 7, 9, 10, 12 | ||
| , |
The square of a sum of words has a linear number of nodes, while it has a quadratic number of monomials.
Correctness
Canonicity. The Taylor coefficients of a polynomial by are unique, because is the ring of polynomials in over . And does not depend on exactly when all coefficients after the 0-th are zero. With these two facts, the induction of BDD canonicity goes through. Every inner node depends on its variable, by the trailing-zeros rule. Two nodes with the same polynomial on the same level have the same coefficients, hence by induction the same children, and the merging rule makes them one node. So over , two polynomials are equal exactly when their nodes are the same. Since is infinite, this is also equality as functions. ADD and MUL are correct by the identities above, and EVALUATE by Horner's rule. The full proofs are in the proof file.
The tests check canonicity on 300 random expressions with fixed seeds: each expression and a second form of the same polynomial, with the monomials and factors in random order, give the same node, and a changed coefficient gives another node. On 400 more expressions, two nodes are equal exactly when the polynomials, expanded independently, are equal. The tests also check that the -th child of the root is at , that EVALUATE agrees with the expanded polynomial at random rational points, and that the store stays reduced.
Proof: Reduced ordered TEDs are canonical, and ADD, MUL and EVALUATE are correctfull
The variables are in this order, and all polynomials have rational coefficients. Write , so . A sink has the level and the polynomial . An inner node has the level , its children have larger levels, and . By induction from the sinks, . The store is reduced if every inner node has and not the sink 0, no two sinks hold the same number, and no two inner nodes have the same key . Lines L1 to L4 of MK keep it reduced, and CONST keeps the sinks distinct.
Lemma 1 (Taylor coefficients). Let . (a) There are unique and with or , such that . (b) . (c) if and only if .
Proof. (a) is the ring of polynomials in with coefficients in : group the monomials of by their power of . A polynomial in has unique coefficients, so the are unique, and is the degree, or 0 for . (b) For , , and for it is 0. At only is left, which gives . The field has characteristic 0, so we may divide by . (c) By uniqueness in (a).
So a node is exactly the Taylor expansion of its polynomial at , cut after the last nonzero term. Equality here is equality of polynomials. Over the infinite field a polynomial that is 0 at every point is the zero polynomial, so it is also equality of functions on .
Theorem 2 (canonicity). In a reduced store, (a) the polynomial of every inner node on level is not in , and (b) two distinct nodes have distinct polynomials.
Proof. By induction on from down to 1, for the nodes on levels and above. For the nodes are sinks with distinct numbers, so (b) holds, and (a) has no cases.
Let . Its children are on levels above . The child is not the sink 0, and the sink 0 has the polynomial 0, so by (b) for those levels . With , Lemma 1(a) says that is the degree of in , and Lemma 1(c) gives . This is (a).
For (b), let be nodes on levels and above with . If both are above level , (b) for those levels gives a contradiction. If is on level and above it, then and by (a), a contradiction. If and , then Lemma 1(a) gives and for all . By (b) for the higher levels , so and have the same key, and the merging of lines L3 and L4 gives .
Corollary. A node whose polynomial lies in is on a level larger than : an inner node on level has a polynomial outside . And EQUAL by node ids is correct.
Lemma 3 (MK and coef). (a) MK, with all on levels larger than , returns a node with the polynomial . (b) If is at most the level of and , then and every is on a level larger than .
Proof. (a) Line L1 drops children that are the sink 0, which add . If one child is left, line L2 returns it, and its polynomial is the sum. Otherwise lines L3 and L4 return the node with that key. (b) If is on level , this is the definition of . If not, returns , and .
Theorem 4 (ADD). ADD returns the node of , and at most calls reach line L6.
Proof. By induction on the sum of the levels of the arguments. The shortcuts for the sink 0 and line L5 are correct. The cache returns only results of earlier calls with the same pair, in either order, which is correct because addition commutes. At line L6, Lemma 3(b) gives , with the shorter list padded by the sink 0. Each recursive call has both arguments on levels larger than , so the level sum grows, and by induction it returns the node of . By the corollary that node is on a level larger than , so Lemma 3(a) applies and MK returns the node of the sum. The arguments of every call are nodes reachable from and from , or the sink 0, which the shortcut handles, and the cache lets each pair reach line L6 once.
Theorem 5 (MUL). MUL returns the node of .
Proof. By induction on the sum of the levels, as for ADD. The shortcuts for 0 and 1 and line L7 are correct, and so is the cache, since multiplication commutes. At line L8, with and from Lemma 3(b), the coefficients lie in and commute with , so
Each MUL has both arguments on levels larger than , so by induction it returns the node of , and ADD (Theorem 4) sums them in , the node of the inner sum. By the corollary every is on a level larger than , and Lemma 3(a) gives the result at line L9.
EVALUATE and BUILD. Line L10 computes, children first, by Horner's rule, so by induction at the point. BUILD at line L11 is correct by induction on the expression: a variable is MK, the polynomial , a number is a sink, and , and are ADD, ADD with MUL by , and MUL. A power is repeated MUL. So two expressions of the same polynomial give the same node, by Theorem 2.
Complexity
| operation | time | notes |
|---|---|---|
| MK, CONST | expected | one hash of up to children |
| ADD | expected | each pair of nodes once |
| MUL | no general polynomial bound is given here | each pair once, but each step runs ADD on intermediate results |
| EVALUATE | all reachable nodes | |
| space | up to children per node |
is the largest degree of one variable. The times count rational operations as . Coefficients of products can grow large, so exact arithmetic costs more for high degrees and many factors.
Variants
- Normalized weighted TEDs. Ciesielski, Kalla and Askar put multiplicative weights on the edges and normalize them, so that common factors such as the of a bit vector or a constant multiple move into the weights. The rules are chosen so that the normalized form stays canonical.
- Bit-level variables. A variable that takes only 0 and 1 obeys , so its node has the children for and only. Such a node is a moment node of a BMD, so a TED over 0-1 variables is a BMD, and a word links the word level to the bits.
- Other bases. An ADD uses the Shannon expansion for functions of bits to numbers, and KFDDs choose an expansion per variable. TEDs are the polynomial case with a Taylor basis per word variable.
- Polynomials modulo . A real datapath computes modulo , where different polynomials can give the same function. A TED over then proves equivalence only when the two polynomials are equal. The canonical forms of polynomial functions modulo need extra rules.
When to use it
Use a TED to check that two arithmetic datapaths, given as expressions over words, compute the same polynomial: rewrites of a filter, a transform, a sum of products, or a high-level synthesis step. The cost depends on the number of words and their degrees, not on the width of the words. For control logic, comparisons and other bit-level functions, BDDs and SAT are the right tools. For a gate-level multiplier, the structure is not a word-level expression, and the algebraic method that rewrites the gate polynomials is the usual choice. For one-off identity tests, random evaluation at a few points is cheaper but gives no canonical form.
Pitfalls
- Field of characteristic 0. The Taylor coefficients divide by , and canonicity uses unique coefficients over a field. Over the integers modulo the same diagram is still a correct representation of a polynomial, but equal functions need not have equal polynomials, so different nodes do not prove that two designs differ.
- The variable order. The diagram is canonical only for a fixed order, and its size depends on the order. Both sides of a check must use the same manager and the same order.
- Evaluation visits all nodes. As in a BMD, the value is a sum over many paths, not one path.
- Big numbers. Coefficients are exact rationals. Fixed-width numbers overflow for large products.
- Mixed bits and words. A variable that is really a bit must use . Treating it as a word variable makes and different nodes, and two equal bit-level designs look different.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/taylor-expansion-diagram/. The authors are listed in prov/B790DF.jsonl.
"""Reduced ordered Taylor expansion diagrams over the rationals.
A node (v, (c_0, ..., c_d)) stands for the polynomial sum_k x_v^k f_{c_k}, where
f_{c_k} = (1/k!) d^k f / dx_v^k at x_v = 0 is the k-th Taylor coefficient. The
children are on later levels. A sink holds one Fraction. MK keeps the diagram
reduced: no trailing zero child, no node with only the 0-th child, and no two
equal nodes. Then two polynomials are equal exactly when their node ids are.
"""
from __future__ import annotations
from fractions import Fraction
from typing import Mapping, Sequence, Union
Expr = Union[tuple, str, int, Fraction]
class TED:
def __init__(self, order: Sequence[str]) -> None:
self.order = list(order)
self.level = {name: i for i, name in enumerate(self.order)}
self.n = len(self.order)
self.nodes: list[tuple] = [] # id -> ("c", q) or (level, children)
self.unique: dict[tuple, int] = {}
self.add_cache: dict[tuple[int, int], int] = {}
self.mul_cache: dict[tuple[int, int], int] = {}
self.zero = self.const(0)
self.one = self.const(1)
# ------------------------------------------------------------------ nodes
def const(self, q) -> int:
key = ("c", Fraction(q))
u = self.unique.get(key)
if u is None:
u = len(self.nodes)
self.nodes.append(key)
self.unique[key] = u
return u
def is_const(self, u: int) -> bool:
return self.nodes[u][0] == "c"
def value(self, u: int) -> Fraction:
return self.nodes[u][1]
def var_level(self, u: int) -> int:
return self.n if self.is_const(u) else self.nodes[u][0]
def children(self, u: int) -> tuple[int, ...]:
return self.nodes[u][1]
def mk(self, v: int, children: Sequence[int]) -> int:
ch = list(children)
while len(ch) > 1 and ch[-1] == self.zero: # @line L1
ch.pop()
if len(ch) == 1: # @line L2
return ch[0]
key = (v, tuple(ch))
u = self.unique.get(key) # @line L3
if u is None:
u = len(self.nodes) # @line L4
self.nodes.append(key)
self.unique[key] = u
return u
def var(self, name: str) -> int:
return self.mk(self.level[name], (self.zero, self.one))
def coef(self, u: int, v: int) -> list[int]:
"""The Taylor coefficients of u by the variable of level v <= level of u."""
return list(self.children(u)) if self.var_level(u) == v else [u]
# ------------------------------------------------------------- operations
def add(self, f: int, g: int) -> int:
if f == self.zero:
return g
if g == self.zero:
return f
if self.is_const(f) and self.is_const(g): # @line L5
return self.const(self.value(f) + self.value(g))
key = (min(f, g), max(f, g))
r = self.add_cache.get(key)
if r is None:
v = min(self.var_level(f), self.var_level(g)) # @line L6
a, b = self.coef(f, v), self.coef(g, v)
m = max(len(a), len(b))
a += [self.zero] * (m - len(a))
b += [self.zero] * (m - len(b))
r = self.mk(v, [self.add(x, y) for x, y in zip(a, b)])
self.add_cache[key] = r
return r
def mul(self, f: int, g: int) -> int:
if f == self.zero or g == self.zero:
return self.zero
if f == self.one:
return g
if g == self.one:
return f
if self.is_const(f) and self.is_const(g): # @line L7
return self.const(self.value(f) * self.value(g))
key = (min(f, g), max(f, g))
r = self.mul_cache.get(key)
if r is None:
v = min(self.var_level(f), self.var_level(g)) # @line L8
a, b = self.coef(f, v), self.coef(g, v)
c = [self.zero] * (len(a) + len(b) - 1)
for i, x in enumerate(a):
for j, y in enumerate(b):
c[i + j] = self.add(c[i + j], self.mul(x, y))
r = self.mk(v, c) # @line L9
self.mul_cache[key] = r
return r
def neg(self, f: int) -> int:
return self.mul(self.const(-1), f)
def evaluate(self, u: int, point: Mapping[str, Fraction]) -> Fraction:
val: dict[int, Fraction] = {}
def go(w: int) -> Fraction:
if w in val:
return val[w]
if self.is_const(w):
r = self.value(w)
else: # @line L10
x = Fraction(point[self.order[self.var_level(w)]])
r = Fraction(0)
for c in reversed(self.children(w)): # Horner
r = r * x + go(c)
val[w] = r
return r
return go(u)
def build(self, e: Expr) -> int:
"""The node of an expression: a variable name, a number, or (op, a, b)
with op in '+', '-', '*', or ('^', a, k) for a power k >= 0."""
if isinstance(e, str): # @line L11
return self.var(e)
if isinstance(e, (int, Fraction)):
return self.const(e)
op = e[0]
if op == "^":
r, base = self.one, self.build(e[1])
for _ in range(e[2]):
r = self.mul(r, base)
return r
a, b = self.build(e[1]), self.build(e[2])
if op == "+":
return self.add(a, b)
if op == "-":
return self.add(a, self.neg(b))
return self.mul(a, b)
# ---------------------------------------------------------------- reading
def reachable(self, u: int) -> set[int]:
seen, todo = set(), [u]
while todo:
w = todo.pop()
if w not in seen:
seen.add(w)
if not self.is_const(w):
todo.extend(self.children(w))
return seen
def size(self, u: int) -> int:
return len(self.reachable(u))
def to_poly(self, u: int) -> dict[tuple[int, ...], Fraction]:
"""Unfold u into {exponent vector: coefficient}, with nonzero coefficients."""
if self.is_const(u):
q = self.value(u)
return {(0,) * self.n: q} if q else {}
v = self.var_level(u)
out: dict[tuple[int, ...], Fraction] = {}
for k, c in enumerate(self.children(u)):
for mono, q in self.to_poly(c).items():
m = list(mono)
m[v] += k
out[tuple(m)] = q
return out
test_taylor_expansion_diagram.py 193 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/taylor-expansion-diagram/. The authors are listed in prov/B790DF.jsonl.
import random
from fractions import Fraction
from math import factorial
from taylor_expansion_diagram import TED
F = Fraction
VARS = ("a", "b", "c", "d")
# ------------------------------------------------- a reference: dicts of monomials
def p_add(p, q):
out = dict(p)
for m, c in q.items():
out[m] = out.get(m, 0) + c
if out[m] == 0:
del out[m]
return out
def p_mul(p, q):
out = {}
for m1, c1 in p.items():
for m2, c2 in q.items():
m = tuple(x + y for x, y in zip(m1, m2))
out[m] = out.get(m, 0) + c1 * c2
if out[m] == 0:
del out[m]
return out
def expand(e, names=VARS):
n = len(names)
if isinstance(e, str):
m = [0] * n
m[names.index(e)] = 1
return {tuple(m): F(1)}
if isinstance(e, (int, Fraction)):
return {(0,) * n: F(e)} if e else {}
if e[0] == "^":
r, base = {(0,) * n: F(1)}, expand(e[1], names)
for _ in range(e[2]):
r = p_mul(r, base)
return r
a, b = expand(e[1], names), expand(e[2], names)
if e[0] == "+":
return p_add(a, b)
if e[0] == "-":
return p_add(a, {m: -c for m, c in b.items()})
return p_mul(a, b)
def random_expr(rng, depth):
if depth == 0 or rng.random() < 0.25:
if rng.random() < 0.6:
return rng.choice(VARS)
return F(rng.randint(-3, 3), rng.randint(1, 3))
op = rng.choice("++-**^")
if op == "^":
return ("^", random_expr(rng, depth - 1), rng.randint(0, 3))
return (op, random_expr(rng, depth - 1), random_expr(rng, depth - 1))
def as_sum_of_monomials(p, rng, names=VARS):
"""Another expression of the same polynomial: shuffled monomials and factors."""
terms = list(p.items())
rng.shuffle(terms)
e = 0
for mono, c in terms:
factors = [n for n, k in zip(names, mono) for _ in range(k)]
rng.shuffle(factors)
t = c
for x in factors:
t = ("*", x, t) if rng.random() < 0.5 else ("*", t, x)
e = ("+", t, e) if rng.random() < 0.5 else ("+", e, t)
return e
def check_reduced(t):
seen = set()
for u, node in enumerate(t.nodes):
assert node not in seen
seen.add(node)
if node[0] != "c":
v, ch = node
assert len(ch) >= 2 and ch[-1] != t.zero
assert all(t.var_level(c) > v for c in ch)
# ----------------------------------------------------------------------- tests
def test_example_of_the_page():
t = TED(("a", "b"))
square = t.build(("*", ("+", "a", "b"), ("+", "a", "b")))
expanded = t.build(("+", ("+", ("*", "a", "a"), ("*", 2, ("*", "a", "b"))), ("*", "b", "b")))
assert square == expanded
assert t.size(square) == 6 # 3 inner nodes, sinks 0, 1, 2
root = t.nodes[square]
assert root[0] == 0 and len(root[1]) == 3 # children for k = 0, 1, 2
assert t.to_poly(root[1][0]) == {(0, 2): 1} # f(0, b) = b^2
assert t.to_poly(root[1][1]) == {(0, 1): 2} # df/da at a = 0 is 2b
assert root[1][2] == t.one # (1/2) d2f/da2 = 1
def test_rational_example():
t = TED(("x",))
f = t.build(("*", ("+", "x", F(1, 2)), ("-", "x", F(1, 3))))
g = t.build(("+", ("+", ("^", "x", 2), ("*", F(1, 6), "x")), F(-1, 6)))
assert f == g
assert [t.value(c) for c in t.children(f)] == [F(-1, 6), F(1, 6), F(1)]
def test_datapath_rewrite():
t = TED(("A", "B", "C"))
assert t.build(("+", ("*", "A", "B"), ("*", "A", "C"))) == t.build(("*", "A", ("+", "B", "C")))
assert t.build(("-", ("*", "A", "B"), ("*", "B", "A"))) == t.zero
assert t.build(("*", "A", "B")) != t.build(("*", "A", "C"))
def test_canonicity_on_random_expressions():
rng = random.Random(1806)
for _ in range(300):
t = TED(VARS)
e = random_expr(rng, 4)
p = expand(e)
u = t.build(e)
assert t.to_poly(u) == {m: c for m, c in p.items()}
assert t.build(as_sum_of_monomials(p, rng)) == u
# A changed coefficient gives another node.
mono = (rng.randint(0, 2), rng.randint(0, 2), 0, 0)
q = p_add(p, {mono: F(1, 7)})
assert t.build(as_sum_of_monomials(q, rng)) != u
check_reduced(t)
def test_equal_nodes_iff_equal_polynomials():
rng = random.Random(77)
t = TED(VARS)
seen = {}
for _ in range(400):
e = random_expr(rng, 3)
key = tuple(sorted(expand(e).items()))
u = t.build(e)
if key in seen:
assert seen[key] == u
else:
assert u not in seen.values()
seen[key] = u
assert len(seen) > 100
check_reduced(t)
def test_children_are_taylor_coefficients():
rng = random.Random(5)
for _ in range(100):
t = TED(VARS)
p = expand(random_expr(rng, 4))
u = t.build(as_sum_of_monomials(p, rng))
if t.is_const(u):
continue
v = t.var_level(u)
for k, c in enumerate(t.children(u)):
# (1/k!) d^k f / dx_v^k at x_v = 0
deriv = {}
for m, q in p.items():
if m[v] >= k:
m2 = list(m)
m2[v] -= k
deriv[tuple(m2)] = q * factorial(m[v]) / factorial(m[v] - k)
at_zero = {m: q / factorial(k) for m, q in deriv.items() if m[v] == 0}
assert t.to_poly(c) == at_zero
def test_evaluate_matches_the_expression():
rng = random.Random(9)
for _ in range(200):
t = TED(VARS)
e = random_expr(rng, 4)
u = t.build(e)
point = {x: F(rng.randint(-5, 5), rng.randint(1, 4)) for x in VARS}
want = sum((c * prod_pow(point, m) for m, c in expand(e).items()), F(0))
assert t.evaluate(u, point) == want
def prod_pow(point, mono):
r = F(1)
for x, k in zip(VARS, mono):
r *= point[x] ** k
return r
History
Ciesielski, Kalla, Zeng and Rouzeyre presented TEDs for register-transfer level verification at the High-Level Design Validation and Test Workshop in 2001 and at DATE 2002. Ciesielski, Kalla and Askar gave the journal paper in the IEEE Transactions on Computers in 2006, with normalized weights and the use for data flow designs. TEDs extend the word-level line of decision diagrams that started with the BMDs of Bryant and Chen (1995), which handle words through their bits.
References
- M. Ciesielski, P. Kalla and S. Askar, Taylor expansion diagrams, a canonical representation for verification of data flow designs, IEEE Transactions on Computers 55(9), 1188 to 1201, 2006, the decomposition of a polynomial by the Taylor series in one variable at a time, the reduction and normalization rules, canonicity for a fixed variable order, the operations, and the use for equivalence of data flow designs
- M. J. Ciesielski, P. Kalla, Z. Zeng and B. Rouzeyre, Taylor expansion diagrams, a compact, canonical representation with applications to symbolic verification, Design, Automation and Test in Europe (DATE 2002), 285 to 289, 2002, TEDs as a compact canonical form of polynomials and their use in symbolic verification
- M. Ciesielski, P. Kalla, Z. Zeng and B. Rouzeyre, Taylor expansion diagrams, a new representation for RTL verification, IEEE International High-Level Design Validation and Test Workshop (HLDVT 2001), 70 to 75, 2001, the first presentation of TEDs for register-transfer level verification
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.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag B790DF Edit this page History Report an error Markdown