1) The document discusses unification and the union-find algorithm for efficiently solving unification problems.
2) Unification involves resolving constraints between terms to find a substitution that makes the terms equal. This can have exponential time and space complexity.
3) The union-find algorithm uses set representatives and linking to maintain disjoint sets in near-constant time complexity, improving on naive recursive algorithms.
4) An example shows how union-find can be applied to fully unify a complex expression by progressively linking variables and subterms between the two sides.
The document discusses derivatives and graphs. It defines interval notation used to indicate whether points are included or excluded from intervals. It then explains that the derivative of a function f(x) at a point x, f'(x), represents the slope of the tangent line to the graph of f(x) at (x, f(x)). Finally, it notes that points where the derivative is 0 are called critical points, as the tangent line is flat at these points.
Theorems of Boolean algebra:
THEOREMS (a) (b)
1 Idempotent x + x = x x . x = x
2 Involution (x’)’ = x
3 Absorption x+ xy = x x (x+ y) = x
DeMorgan’s Theorems state that the complement of a product is equal to the sum of the complements and the complement of a sum is equal to the product of the complements. Boolean expressions can be simplified using properties, laws, and theorems of Boolean algebra such as consensus theorem.
4.2 exponential functions and compound interestsmath260
The document discusses exponential functions and their properties. It defines exponential functions as functions of the form f(x) = bx where b > 0 and b ≠ 1. The rules for exponents such as b0, b-k, √b, fractional exponents, and real number exponents are explained. Examples are provided to illustrate calculating exponential functions. Exponential functions appear in various fields such as finance, science, and are important as they model growth rates. The most common exponential functions y = 10x, y = ex, and y = 2x are noted. An example of compound interest calculation is given to demonstrate the application of exponential growth.
- The derivative of a function f(x) represents the instantaneous rate of change of the output y with respect to the input x. It is equivalent to the slope of the tangent line and the amount of change in y for a 1 unit change in x.
- For a linear price-demand function of y = f(x) chickens sold given price x, the derivative of the revenue function R(x) = x*f(x) represents how revenue changes with a 1 unit change in price.
- The price that maximizes revenue occurs when the derivative of the revenue function R'(x) is 0, as this is where revenue is no longer increasing or decreasing with small changes in price.
The document discusses the concept of slope and the difference quotient formula for calculating slope. It defines a function f(x) and points P(x,f(x)) and Q(x+h, f(x+h)) on the graph of f(x). The slope of the cord connecting points P and Q is given by the difference quotient (f(x+h) - f(x))/h. An example problem calculates this slope for the specific points P(2,2) and Q(2.2,2.44) on the parabola y=x^2 - 2x + 2.
THE CHORD GAP DIVERGENCE AND A GENERALIZATION OF THE BHATTACHARYYA DISTANCEFrank Nielsen
The document introduces the chord gap divergence, a generalization of the Bhattacharyya distance and skew Jensen divergence. The chord gap divergence is defined as the vertical distance between an upper and lower chord in the graph of a convex function, and can be expressed as the difference of two skew Jensen divergences. This provides a geometric interpretation and allows the chord gap divergence to be used as a distance metric for clustering algorithms like k-means++. The divergence is also linked to statistical divergences between distributions in the same exponential family.
This document discusses Boolean algebra properties and concepts. It defines Boolean variables and constants, and lists common Boolean algebra properties like idempotence, complement, duality, commutativity, associativity, distributivity, De Morgan's laws, and absorption. It also discusses Boolean expressions, truth tables, canonical forms, minterms, maxterms, and how to derive the complement and canonical forms of a Boolean function.
Optimization of probabilistic argumentation with Markov processesEmmanuel Hadoux
This document describes research on optimizing probabilistic argumentation strategies using Markov processes. It introduces argumentation problems with probabilistic strategies (APS) and formalizes them using probabilistic finite state machines. It then describes how an APS can be transformed into a mixed-observability Markov decision process (MOMDP) to allow for optimization without full knowledge of the initial state or opponent's private state. Algorithms for solving MOMDPs like MO-IP and MO-SARSOP are discussed. Different types of optimizations for the MOMDP are also presented, including removing irrelevant arguments, inferring attacks, and removing dominated arguments, both with and without dependencies on the initial state.
The document discusses derivatives and graphs. It defines interval notation used to indicate whether points are included or excluded from intervals. It then explains that the derivative of a function f(x) at a point x, f'(x), represents the slope of the tangent line to the graph of f(x) at (x, f(x)). Finally, it notes that points where the derivative is 0 are called critical points, as the tangent line is flat at these points.
Theorems of Boolean algebra:
THEOREMS (a) (b)
1 Idempotent x + x = x x . x = x
2 Involution (x’)’ = x
3 Absorption x+ xy = x x (x+ y) = x
DeMorgan’s Theorems state that the complement of a product is equal to the sum of the complements and the complement of a sum is equal to the product of the complements. Boolean expressions can be simplified using properties, laws, and theorems of Boolean algebra such as consensus theorem.
4.2 exponential functions and compound interestsmath260
The document discusses exponential functions and their properties. It defines exponential functions as functions of the form f(x) = bx where b > 0 and b ≠ 1. The rules for exponents such as b0, b-k, √b, fractional exponents, and real number exponents are explained. Examples are provided to illustrate calculating exponential functions. Exponential functions appear in various fields such as finance, science, and are important as they model growth rates. The most common exponential functions y = 10x, y = ex, and y = 2x are noted. An example of compound interest calculation is given to demonstrate the application of exponential growth.
- The derivative of a function f(x) represents the instantaneous rate of change of the output y with respect to the input x. It is equivalent to the slope of the tangent line and the amount of change in y for a 1 unit change in x.
- For a linear price-demand function of y = f(x) chickens sold given price x, the derivative of the revenue function R(x) = x*f(x) represents how revenue changes with a 1 unit change in price.
- The price that maximizes revenue occurs when the derivative of the revenue function R'(x) is 0, as this is where revenue is no longer increasing or decreasing with small changes in price.
The document discusses the concept of slope and the difference quotient formula for calculating slope. It defines a function f(x) and points P(x,f(x)) and Q(x+h, f(x+h)) on the graph of f(x). The slope of the cord connecting points P and Q is given by the difference quotient (f(x+h) - f(x))/h. An example problem calculates this slope for the specific points P(2,2) and Q(2.2,2.44) on the parabola y=x^2 - 2x + 2.
THE CHORD GAP DIVERGENCE AND A GENERALIZATION OF THE BHATTACHARYYA DISTANCEFrank Nielsen
The document introduces the chord gap divergence, a generalization of the Bhattacharyya distance and skew Jensen divergence. The chord gap divergence is defined as the vertical distance between an upper and lower chord in the graph of a convex function, and can be expressed as the difference of two skew Jensen divergences. This provides a geometric interpretation and allows the chord gap divergence to be used as a distance metric for clustering algorithms like k-means++. The divergence is also linked to statistical divergences between distributions in the same exponential family.
This document discusses Boolean algebra properties and concepts. It defines Boolean variables and constants, and lists common Boolean algebra properties like idempotence, complement, duality, commutativity, associativity, distributivity, De Morgan's laws, and absorption. It also discusses Boolean expressions, truth tables, canonical forms, minterms, maxterms, and how to derive the complement and canonical forms of a Boolean function.
Optimization of probabilistic argumentation with Markov processesEmmanuel Hadoux
This document describes research on optimizing probabilistic argumentation strategies using Markov processes. It introduces argumentation problems with probabilistic strategies (APS) and formalizes them using probabilistic finite state machines. It then describes how an APS can be transformed into a mixed-observability Markov decision process (MOMDP) to allow for optimization without full knowledge of the initial state or opponent's private state. Algorithms for solving MOMDPs like MO-IP and MO-SARSOP are discussed. Different types of optimizations for the MOMDP are also presented, including removing irrelevant arguments, inferring attacks, and removing dominated arguments, both with and without dependencies on the initial state.
This document discusses solving numerical equations involving logarithmic and exponential functions. It provides examples of solving both log equations and exponential equations. To solve log equations, the problems are rewritten in exponential form by removing the log. To solve exponential equations, the exponents are brought down by rewriting the problem in logarithmic form. Steps include isolating the exponential or logarithmic term containing the unknown, rewriting the equation accordingly, and then solving for the unknown variable. Practice problems with solutions are provided to illustrate the process.
The document discusses functions and their basic language. It defines a function as a procedure that assigns each input exactly one output. It provides examples of functions, such as a license number to name function. It explains that a function must have a domain (set of inputs) and range (set of outputs). Functions can be represented graphically, through tables of inputs and outputs, or with mathematical formulas.
“Going bananas with recursion schemes for fixed point data types”Pawel Szulc
The document discusses representing and evaluating recursive expressions using functional programming techniques. It defines an Exp algebraic data type to represent expressions like integers, doubles, sums, products, divisions and squares. It then implements functions to evaluate and optimize expressions represented as Exp values. An example expression is given involving multiplication, summation and division.
The document discusses exponential and logarithmic functions. Exponential functions of the form f(x) = b^x are called exponential functions in base b. Logarithmic functions log_b(y) represent the exponent x needed to raise the base b to a power to get the output y. The exponential form b^x = y and logarithmic form x = log_b(y) describe the same relationship between the base b, exponent x, and output y. Questions can be translated between these forms by rewriting the exponential expression as a logarithm or vice versa. Examples demonstrate rewriting expressions and graphing logarithmic functions.
Slides: Hypothesis testing, information divergence and computational geometryFrank Nielsen
Bayesian multiple hypothesis testing can be viewed from the perspective of computational geometry. The probability of error can be upper bounded by divergences such as the total variation and Chernoff distance. When the hypotheses are distributions from an exponential family, the optimal MAP Bayesian rule is a nearest neighbor classifier on an additive Bregman Voronoi diagram. For binary hypotheses, the best error exponent is the Chernoff information, which is a Bregman divergence on the exponential family manifold. This viewpoint generalizes to multiple hypotheses, where the best error exponent comes from the closest Bregman pair of distributions.
The document discusses solving numerical equations involving logarithmic and exponential functions in base 10 or base e. It provides examples of solving log and exponential equations by isolating the part containing the unknown, then rewriting the equation in the opposite form (log to exponential or exponential to log). The key steps outlined are: 1) isolate the exponential/log part containing the unknown, 2) rewrite the equation by "bringing down" exponents as logarithms or vice versa. Several examples are worked through demonstrating these steps.
Functions Representations
CMSC 56 | Discrete Mathematical Structure for Computer Science
October 13, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
The document summarizes key concepts about the binomial and geometric distributions:
The binomial distribution models the number of successes in a fixed number of yes/no trials where the probability of success is constant. The geometric distribution models the number of trials until the first success. Both have calculators functions and follow patterns for mean, standard deviation, and normal approximations. Formulas for probability mass and cumulative distribution functions are provided.
The document discusses solving numerical equations involving logarithmic and exponential functions in base 10 or base e. It provides examples of solving both log equations, by rewriting them in exponential form, and exponential equations, by rewriting them in logarithmic form. The key steps are to isolate the part containing the unknown, then rewrite the equation by "bringing down" exponents or taking the logarithm/exponential to solve for the unknown.
This document discusses exponents and exponent rules. It defines exponents as multiplying a base A by itself repeatedly N times, written as AN. It then provides several exponent rules including:
- Multiply-Add Rule: AnAk = An+k
- Divide-Subtract Rule: An/Ak = An-k
- Power-Multiply Rule: (An)k = Ank
Special exponents are also discussed such as A0=1 if A≠0, A-k=1/Ak, and calculating fractional exponents by extracting the root first then raising it to the numerator power. Examples are provided to demonstrate applying these exponent rules and calculating fractional exponents.
1. This document contains the code for a Java programming assignment with 9 problems. It includes documentation comments and method signatures for solving each problem.
2. The problems involve tasks like summing values with certain conditions, rounding numbers, determining if values are evenly spaced, and making configurations of items to meet a goal.
3. Helper methods are created to avoid repeating code, like a method to fix teen values for one of the problems.
This document discusses complex numbers. It defines a complex number z as an ordered pair (x, y) of real numbers x and y, written as z = x + jy, where j is the imaginary unit equal to √-1. It describes how to add, subtract, multiply and divide complex numbers. It also introduces the polar form r∠θ of a complex number and explains how arithmetic operations are simpler in polar form than rectangular form. It defines the modulus, argument and principal argument of a complex number and provides examples of evaluating powers and roots of complex numbers.
1. The document discusses practical representations of imprecise probabilities, which represent uncertainty as a set of probabilities rather than a single probability.
2. It provides an overview of several practical representations, including possibility distributions, P-boxes, probability intervals, and elementary comparative probabilities.
3. The representations aim to be computationally tractable by having a reasonable number of extreme points and satisfying properties like n-monotonicity.
3.2 implicit equations and implicit differentiationmath265
The document discusses implicit equations and implicit differentiation. It begins by explaining the difference between explicit and implicit forms of equations, using the example of y=1/x which can be written explicitly as y=1/x or implicitly as xy=1. It then introduces the concept of implicit differentiation, which involves taking the derivative of an implicit equation with respect to x and solving for the derivative of y with respect to x (y’). This allows one to find the slope of the curve at a point, even if the explicit form of the relation between x and y is difficult to determine from the implicit equation.
The document discusses the concept of slope as it relates to functions. It introduces function notation and defines a function's output f(x). It explains that the slope of the line connecting two points (x, f(x)) and (x+h, f(x+h)) on a function graph is given by the difference quotient formula: m = (f(x+h) - f(x))/h. An example calculates the slope of the cord between points on the graph of f(x) = x^2 - 2x + 2.
2.2 exponential function and compound interestmath123c
The document discusses exponential functions and their properties. It defines exponential functions as functions of the form f(x) = bx where b > 0 and b ≠ 1. Some key points made in the document include:
- The rules for exponents such as b0, b-k, (√b)k, and (b1/k) are explained.
- Exponential functions are defined for all real numbers x.
- Examples are provided to illustrate calculating exponential expressions and functions with integer, fractional, decimal, and real-number exponents.
- Exponential functions appear in various fields like finance, science, and engineering. Common exponential functions mentioned are y = 10x, y = ex, and y
This document provides a table of common derivative rules for basic functions like polynomials, exponentials, logarithms, and trigonometric functions. It includes the derivative rules and examples of applying each rule. It then lists 100 specific functions and states that the goal is to take the derivative of each using the rules from the table.
The document is a problem set that contains 8 questions:
1. Name 3 elements and 3 subsets of the set A = {∅, a, b, c, d, e, f} and explain why a repeated element is irrelevant.
2. Find the union of the sets E = {2n : n is an integer} and O = {2n + 1 : n is an integer}.
3. Find the intersection of E and O.
4. Solve several linear equations.
5. Solve several quadratic equations.
6. Solve a cubic equation.
7. Generalize the distributive property to higher orders.
8. Pro
Bregman divergences from comparative convexityFrank Nielsen
This document discusses generalized divergences and comparative convexity. It introduces Jensen divergences, Bregman divergences, and their generalizations to quasi-arithmetic and weighted means. Quasi-arithmetic Bregman divergences are defined for strictly (ρ,τ)-convex functions using two strictly monotone functions ρ and τ. Power mean Bregman divergences are obtained as a subfamily when ρ(x)=xδ1 and τ(x)=xδ2. A criterion is given to check (ρ,τ)-convexity by testing the ordinary convexity of the transformed function G=Fρ,τ.
There are infinitely many maximal primitive positive clones in a diagonalizable algebra M* that serves as an algebraic model for provability logic GL. The paper constructs M* as the subalgebra of infinite binary sequences generated by the zero element (0,0,...). It defines primitive positive clones as sets of operations closed under existential definitions, and shows there are infinitely many maximal clones K1, K2, etc. that preserve the relations x = ¬Δi, x = ¬Δ2, etc. in M*. This provides a simple example of infinitely many maximal primitive positive clones.
This document provides an overview of basic set theory concepts including sets, set operations, functions, sequences, and summations. It defines what sets are and provides examples of common sets used in mathematics like the natural numbers, integers, and real numbers. It explains operations on sets like union, intersection, difference, and complement. Functions are introduced as mappings from one set to another. Important types of functions like one-to-one, onto, and bijective functions are defined. Sequences are described as functions whose domains are subsets of the integers. Summations are introduced as the sum of terms in a sequence. The concept of cardinality or the number of elements in a set is also summarized.
This document discusses solving numerical equations involving logarithmic and exponential functions. It provides examples of solving both log equations and exponential equations. To solve log equations, the problems are rewritten in exponential form by removing the log. To solve exponential equations, the exponents are brought down by rewriting the problem in logarithmic form. Steps include isolating the exponential or logarithmic term containing the unknown, rewriting the equation accordingly, and then solving for the unknown variable. Practice problems with solutions are provided to illustrate the process.
The document discusses functions and their basic language. It defines a function as a procedure that assigns each input exactly one output. It provides examples of functions, such as a license number to name function. It explains that a function must have a domain (set of inputs) and range (set of outputs). Functions can be represented graphically, through tables of inputs and outputs, or with mathematical formulas.
“Going bananas with recursion schemes for fixed point data types”Pawel Szulc
The document discusses representing and evaluating recursive expressions using functional programming techniques. It defines an Exp algebraic data type to represent expressions like integers, doubles, sums, products, divisions and squares. It then implements functions to evaluate and optimize expressions represented as Exp values. An example expression is given involving multiplication, summation and division.
The document discusses exponential and logarithmic functions. Exponential functions of the form f(x) = b^x are called exponential functions in base b. Logarithmic functions log_b(y) represent the exponent x needed to raise the base b to a power to get the output y. The exponential form b^x = y and logarithmic form x = log_b(y) describe the same relationship between the base b, exponent x, and output y. Questions can be translated between these forms by rewriting the exponential expression as a logarithm or vice versa. Examples demonstrate rewriting expressions and graphing logarithmic functions.
Slides: Hypothesis testing, information divergence and computational geometryFrank Nielsen
Bayesian multiple hypothesis testing can be viewed from the perspective of computational geometry. The probability of error can be upper bounded by divergences such as the total variation and Chernoff distance. When the hypotheses are distributions from an exponential family, the optimal MAP Bayesian rule is a nearest neighbor classifier on an additive Bregman Voronoi diagram. For binary hypotheses, the best error exponent is the Chernoff information, which is a Bregman divergence on the exponential family manifold. This viewpoint generalizes to multiple hypotheses, where the best error exponent comes from the closest Bregman pair of distributions.
The document discusses solving numerical equations involving logarithmic and exponential functions in base 10 or base e. It provides examples of solving log and exponential equations by isolating the part containing the unknown, then rewriting the equation in the opposite form (log to exponential or exponential to log). The key steps outlined are: 1) isolate the exponential/log part containing the unknown, 2) rewrite the equation by "bringing down" exponents as logarithms or vice versa. Several examples are worked through demonstrating these steps.
Functions Representations
CMSC 56 | Discrete Mathematical Structure for Computer Science
October 13, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
The document summarizes key concepts about the binomial and geometric distributions:
The binomial distribution models the number of successes in a fixed number of yes/no trials where the probability of success is constant. The geometric distribution models the number of trials until the first success. Both have calculators functions and follow patterns for mean, standard deviation, and normal approximations. Formulas for probability mass and cumulative distribution functions are provided.
The document discusses solving numerical equations involving logarithmic and exponential functions in base 10 or base e. It provides examples of solving both log equations, by rewriting them in exponential form, and exponential equations, by rewriting them in logarithmic form. The key steps are to isolate the part containing the unknown, then rewrite the equation by "bringing down" exponents or taking the logarithm/exponential to solve for the unknown.
This document discusses exponents and exponent rules. It defines exponents as multiplying a base A by itself repeatedly N times, written as AN. It then provides several exponent rules including:
- Multiply-Add Rule: AnAk = An+k
- Divide-Subtract Rule: An/Ak = An-k
- Power-Multiply Rule: (An)k = Ank
Special exponents are also discussed such as A0=1 if A≠0, A-k=1/Ak, and calculating fractional exponents by extracting the root first then raising it to the numerator power. Examples are provided to demonstrate applying these exponent rules and calculating fractional exponents.
1. This document contains the code for a Java programming assignment with 9 problems. It includes documentation comments and method signatures for solving each problem.
2. The problems involve tasks like summing values with certain conditions, rounding numbers, determining if values are evenly spaced, and making configurations of items to meet a goal.
3. Helper methods are created to avoid repeating code, like a method to fix teen values for one of the problems.
This document discusses complex numbers. It defines a complex number z as an ordered pair (x, y) of real numbers x and y, written as z = x + jy, where j is the imaginary unit equal to √-1. It describes how to add, subtract, multiply and divide complex numbers. It also introduces the polar form r∠θ of a complex number and explains how arithmetic operations are simpler in polar form than rectangular form. It defines the modulus, argument and principal argument of a complex number and provides examples of evaluating powers and roots of complex numbers.
1. The document discusses practical representations of imprecise probabilities, which represent uncertainty as a set of probabilities rather than a single probability.
2. It provides an overview of several practical representations, including possibility distributions, P-boxes, probability intervals, and elementary comparative probabilities.
3. The representations aim to be computationally tractable by having a reasonable number of extreme points and satisfying properties like n-monotonicity.
3.2 implicit equations and implicit differentiationmath265
The document discusses implicit equations and implicit differentiation. It begins by explaining the difference between explicit and implicit forms of equations, using the example of y=1/x which can be written explicitly as y=1/x or implicitly as xy=1. It then introduces the concept of implicit differentiation, which involves taking the derivative of an implicit equation with respect to x and solving for the derivative of y with respect to x (y’). This allows one to find the slope of the curve at a point, even if the explicit form of the relation between x and y is difficult to determine from the implicit equation.
The document discusses the concept of slope as it relates to functions. It introduces function notation and defines a function's output f(x). It explains that the slope of the line connecting two points (x, f(x)) and (x+h, f(x+h)) on a function graph is given by the difference quotient formula: m = (f(x+h) - f(x))/h. An example calculates the slope of the cord between points on the graph of f(x) = x^2 - 2x + 2.
2.2 exponential function and compound interestmath123c
The document discusses exponential functions and their properties. It defines exponential functions as functions of the form f(x) = bx where b > 0 and b ≠ 1. Some key points made in the document include:
- The rules for exponents such as b0, b-k, (√b)k, and (b1/k) are explained.
- Exponential functions are defined for all real numbers x.
- Examples are provided to illustrate calculating exponential expressions and functions with integer, fractional, decimal, and real-number exponents.
- Exponential functions appear in various fields like finance, science, and engineering. Common exponential functions mentioned are y = 10x, y = ex, and y
This document provides a table of common derivative rules for basic functions like polynomials, exponentials, logarithms, and trigonometric functions. It includes the derivative rules and examples of applying each rule. It then lists 100 specific functions and states that the goal is to take the derivative of each using the rules from the table.
The document is a problem set that contains 8 questions:
1. Name 3 elements and 3 subsets of the set A = {∅, a, b, c, d, e, f} and explain why a repeated element is irrelevant.
2. Find the union of the sets E = {2n : n is an integer} and O = {2n + 1 : n is an integer}.
3. Find the intersection of E and O.
4. Solve several linear equations.
5. Solve several quadratic equations.
6. Solve a cubic equation.
7. Generalize the distributive property to higher orders.
8. Pro
Bregman divergences from comparative convexityFrank Nielsen
This document discusses generalized divergences and comparative convexity. It introduces Jensen divergences, Bregman divergences, and their generalizations to quasi-arithmetic and weighted means. Quasi-arithmetic Bregman divergences are defined for strictly (ρ,τ)-convex functions using two strictly monotone functions ρ and τ. Power mean Bregman divergences are obtained as a subfamily when ρ(x)=xδ1 and τ(x)=xδ2. A criterion is given to check (ρ,τ)-convexity by testing the ordinary convexity of the transformed function G=Fρ,τ.
There are infinitely many maximal primitive positive clones in a diagonalizable algebra M* that serves as an algebraic model for provability logic GL. The paper constructs M* as the subalgebra of infinite binary sequences generated by the zero element (0,0,...). It defines primitive positive clones as sets of operations closed under existential definitions, and shows there are infinitely many maximal clones K1, K2, etc. that preserve the relations x = ¬Δi, x = ¬Δ2, etc. in M*. This provides a simple example of infinitely many maximal primitive positive clones.
This document provides an overview of basic set theory concepts including sets, set operations, functions, sequences, and summations. It defines what sets are and provides examples of common sets used in mathematics like the natural numbers, integers, and real numbers. It explains operations on sets like union, intersection, difference, and complement. Functions are introduced as mappings from one set to another. Important types of functions like one-to-one, onto, and bijective functions are defined. Sequences are described as functions whose domains are subsets of the integers. Summations are introduced as the sum of terms in a sequence. The concept of cardinality or the number of elements in a set is also summarized.
Declare Your Language: Constraint Resolution 1Eelco Visser
This document provides an overview of constraint resolution and type checking with constraints. It discusses unification theory and the semantics and implementation of constraint solving. Specifically, it covers:
- Unification algorithms and their properties of soundness, completeness, and principality
- The meaning of constraints and how constraint satisfaction is formally defined using constraint semantics
- How to write a constraint solver using the Constraint Handling Rules (CHR) formalism and the semantics of solving subtyping constraints
- The evaluation rules for CHR-based constraint solving, including solving built-in constraints, introducing new constraints, and simplifying/propagating constraints using rewrite rules
- How the CHR rules for subtyping constraints are evaluated using
1) The document provides instructions for a student's first assignment, which includes downloading course materials from the online course webpage and completing a homework assignment on the Webwork system.
2) It emphasizes that students should use Firefox to complete the Webwork homework, as other browsers like Safari and Internet Explorer may cause issues.
3) It also notes that claiming computer problems is not a valid excuse for missing homework, and students must use public computing sites if their own computer is not working.
This document contains a 100 problem inequalities marathon collected from MathLinks.ro. It provides the problems, solutions submitted by participants, and important definitions seen in the problems. The document includes the list of participants, real names if provided, and thanks those who contributed problems and solutions. Readers are invited to submit additional solutions or feedback to the editor.
The document discusses logical equivalence and provides a truth table to show that the statements (P ∨ Q) and (¬P) ∧ (¬Q) are logically equivalent. It shows that ¬(P ∨ Q) ↔ (¬P) ∧ (¬Q) is true according to the truth table.
In this work, numerical computation - such as numerical solution of a PDE - is treated as an inverse problem in its own right. The popular Bayesian approach to inversion is considered, wherein a posterior distribution is induced over the object of interest by conditioning a prior distribution on the same finite information that would be used in a classical numerical method. The main technical consideration is that the data in this context are non-random and thus the standard Bayes' theorem does not hold. General conditions will be presented under which such Bayesian probabilistic numerical methods are well-posed, and a sequential Monte-Carlo method will be shown to provide consistent estimation of the posterior. The paradigm is extended to computational ``pipelines'', through which a distributional quantification of numerical error can be propagated. A sufficient condition is presented for when such propagation can be endowed with a globally coherent Bayesian interpretation, based on a novel class of probabilistic graphical models designed to represent a computational work-flow. The concepts are illustrated through explicit numerical experiments involving both linear and non-linear PDE models. Full details are available in arXiv:1702.03673.
This document discusses affine functions. It defines affine functions as functions of the form f(x) = ax + b, where a and b are real numbers. It provides examples of linear functions where b = 0, constant functions where a = 0, and the identity function where a = 1 and b = 0. It discusses the angular coefficient a and the linear coefficient b. It explains that the graph of an affine function is a straight line that can be increasing or decreasing. It also discusses finding the zero or root of an affine function and studying the sign of an affine function.
The document describes an algorithm for finding the largest integer in a list of numbers. It first defines an algorithm as a precise sequence of instructions to solve a problem. It then provides an English description of the maximum finding algorithm and expresses it in pseudocode. The algorithm assigns the first number as the maximum value, then compares each subsequent number to the current maximum, updating it if a larger number is found. It notes the algorithm uses 2n-1 comparisons to find the maximum number.
Given a function f, the derivative f' can be used to get important information about f. For instance, f is increasing when f'>0. The second derivative gives useful concavity information.
Solutions manual for logic and computer design fundamentals 5th edition by ma...Beckham000
Solutions Manual for Logic and Computer Design Fundamentals 5th Edition by Mano IBSN 9780133760637
Download at:
http://downloadlink.org/p/solutions-manual-for-logic-and-computer-design-fundamentals-5th-edition-by-mano-ibsn-9780133760637/
logic and computer design fundamentals 5th edition solutions
logic and computer design fundamentals 5th edition chegg
logic and computer design fundamentals 3rd edition pdf
logic and computer design fundamentals 2nd edition pdf
digital logic and computer design
logic and computer design fundamentals ppt
logic and computer design fundamentals companion website
logic and computer design fundamentals table of contents
The document discusses Karnaugh maps (K-maps), which are a tool for representing and simplifying Boolean functions with up to six variables. K-maps arrange the variables in a grid according to their binary values. Adjacent cells that differ in only one variable can be combined to simplify the function by eliminating that variable. The document provides examples of using K-maps to minimize Boolean functions in sum of products and product of sums form. It also discusses techniques like combining cells into the largest groups possible and handling don't-care conditions to further simplify expressions.
This document discusses multilinear twisted paraproducts, which are generalizations of classical paraproduct operators to higher dimensions. It begins by reviewing classical paraproducts on the real line and their generalization to higher dimensions using dyadic squares. It then discusses complications that arise, such as twisted paraproducts. The document presents a unified framework for studying such operators using bipartite graphs and selections of vertices. It proves a main boundedness result and discusses special cases like classical dyadic paraproducts and dyadic twisted paraproducts. It introduces tools like Bellman functions and calculus of finite differences to analyze estimates for paraproduct-like operators on finite trees of dyadic squares.
Karnaugh maps are a graphical method used to minimize logic functions. They arrange the minterms of a function in a grid based on the number of variables. Groupings of adjacent 1s in the map correspond to simplified logic terms. The largest possible groupings are used to find a minimum logic expression for the function. Don't cares can also be grouped and treated as 0s or 1s to further simplify expressions.
This document provides a probability cheatsheet compiled by William Chen and Joe Blitzstein with contributions from others. It is licensed under CC BY-NC-SA 4.0 and contains information on topics like counting rules, probability definitions, random variables, expectations, independence, and more. The cheatsheet is designed to summarize essential concepts in probability.
This document provides a probability cheatsheet compiled by William Chen and Joe Blitzstein with contributions from others. It is licensed under CC BY-NC-SA 4.0 and contains information on topics like counting rules, probability definitions, random variables, moments, and more. The cheatsheet is regularly updated with comments and suggestions submitted through a GitHub repository.
Mathematics assignment sample from assignmentsupport.com essay writing services https://writeessayuk.com/
The document proves the product rule for derivatives. It begins by writing the derivative of fg as the limit definition. It then subtracts and adds fg(x) to rewrite this in a form where the limit can be split into two pieces. Taking the limits individually and factoring terms provides the product rule, where the derivative of fg is f'g + fg'.
The document discusses sets and functions. It introduces basic set theory concepts like sets, elements, subsets, set operations, and functions. It defines what a set is, provides examples of common sets like natural numbers and integers, and covers topics like set equality, subsets, cardinality, and the power set. It also defines what a function is, including domain, codomain, range, and using an example to illustrate a function that maps people to cities.
Digital logic circuits important question and answers for 5 unitsLekashri Subramanian
This document provides information about digital logic circuits and binary operations. It includes definitions of key terms like registers, register transfer, binary logic, logic gates, and parity bits. It also covers operations like subtraction using 2's and 1's complements, and reducing Boolean expressions using De Morgan's theorems, duality properties, and canonical forms.
Similar to Declare Your Language: Constraint Resolution 2 (20)
This document discusses syntactic editor services including formatting, syntax coloring, and syntactic completion. It describes how syntactic completion can be provided generically based on a syntax definition. The document also discusses how context-free grammars can be extended with templates to specify formatting layout when pretty-printing abstract syntax trees to text. Templates are used to insert whitespace, line breaks, and indentation to produce readable output.
This document provides an overview of parsing in compiler construction. It discusses context-free grammars and how they are used to generate sentences and parse trees through derivations. It also covers ambiguity that can arise from grammars and various grammar transformations used to eliminate ambiguity, including defining associativity and priority. The dangling else problem is presented as an example of an ambiguous grammar.
This document provides an overview of the Lecture 2 on Declarative Syntax Definition for the CS4200 Compiler Construction course. The lecture covers the specification of syntax definition from which parsers can be derived, the perspective on declarative syntax definition using SDF, and reading material on the SDF3 syntax definition formalism and papers on testing syntax definitions and declarative syntax. It also discusses what syntax is, both in linguistics and programming languages, and how programs can be described in terms of syntactic categories and language constructs. An example Tiger program for solving the n-queens problem is presented to illustrate syntactic categories in Tiger.
This document provides an overview of the CS4200 Compiler Construction course at TU Delft. It discusses the course organization, structure, and assessment. The course is split into two parts - CS4200-A which covers concepts and techniques through lectures, papers, and homework assignments, and CS4200-B which involves building a compiler for a subset of Java as a semester-long project. Students will use the Spoofax language workbench to implement their compiler and will submit assignments through a private GitLab repository.
A Direct Semantics of Declarative Disambiguation RulesEelco Visser
This document discusses research into providing a direct semantics for declarative disambiguation of expression grammars. It aims to define what disambiguation rules mean, ensure they are safe and complete, and provide an effective implementation strategy. The document outlines key research questions around the meaning, safety, completeness and coverage of disambiguation rules. It also presents contributions around using subtree exclusion patterns to define safe and complete disambiguation for classes of expression grammars, and implementing this in SDF3.
Declarative Type System Specification with StatixEelco Visser
In this talk I present the design of Statix, a new constraint-based language for the executable specification of type systems. Statix specifications consist of predicates that define the well-formedness of language constructs in terms of built-in and user-defined constraints. Statix has a declarative semantics that defines whether a model satisfies a constraint. The operational semantics of Statix is defined as a sound constraint solving algorithm that searches for a solution for a constraint. The aim of the design is that Statix users can ignore the execution order of constraint solving and think in terms of the declarative semantics.
A distinctive feature of Statix is its use of scope graphs, a language parametric framework for the representation and querying of the name binding facts in programs. Since types depend on name resolution and name resolution may depend on types, it is typically not possible to construct the entire scope graph of a program before type constraint resolution. In (algorithmic) type system specifications this leads to explicit staging of the construction and querying of the type environment (class table, symbol table). Statix automatically stages the construction of the scope graph of a program such that queries are never executed when their answers may be affected by future scope graph extension. In the talk, I will explain the design of Statix by means of examples.
https://eelcovisser.org/post/309/declarative-type-system-specification-with-statix
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionEelco Visser
Compiler construction techniques are applied beyond general-purpose languages through domain-specific languages (DSLs). The document discusses several DSLs developed using Spoofax including:
- WebDSL for web programming with sub-languages for entities, queries, templates, and access control.
- IceDust for modeling information systems with derived values computed on-demand, incrementally, or eventually consistently.
- PixieDust for client-side web programming with views as derived values updated incrementally.
- PIE for defining software build pipelines as tasks with dynamic dependencies computed incrementally.
The document also outlines several research challenges in compiler construction like high-level declarative language definition, verification of
Domain Specific Languages for Parallel Graph AnalytiX (PGX)Eelco Visser
This document discusses domain-specific languages (DSLs) for parallel graph analytics using PGX. It describes how DSLs allow users to implement graph algorithms and queries using high-level languages that are then compiled and optimized to run efficiently on PGX. Examples of DSL optimizations like multi-source breadth-first search are provided. The document also outlines the extensible compiler architecture used for DSLs, which can generate code for different backends like shared memory or distributed memory.
Compiler Construction | Lecture 15 | Memory ManagementEelco Visser
The document discusses different memory management techniques:
1. Reference counting counts the number of pointers to each record and deallocates records with a count of 0.
2. Mark and sweep marks all reachable records from program roots and sweeps unmarked records, adding them to a free list.
3. Copying collection copies reachable records to a "to" space, allowing the original "from" space to be freed without fragmentation.
4. Generational collection focuses collection on younger object generations more frequently to improve efficiency.
Compiler Construction | Lecture 14 | InterpretersEelco Visser
This document summarizes a lecture on interpreters for programming languages. It discusses how operational semantics can be used to define the meaning of a program through state transitions in an interpreter. It provides examples of defining the semantics of a simple language using DynSem, a domain-specific language for specifying operational semantics. DynSem specifications can be compiled to interpreters that execute programs in the defined language.
Compiler Construction | Lecture 13 | Code GenerationEelco Visser
The document discusses code generation and optimization techniques, describing compilation schemas that define how language constructs are translated to target code patterns, and covers topics like ensuring correctness of generated code through type checking and verification of static constraints on the target format. It also provides examples of compilation schemas for Tiger language constructs like arithmetic expressions and control flow and discusses generating nested functions.
Compiler Construction | Lecture 12 | Virtual MachinesEelco Visser
The document discusses the architecture of the Java Virtual Machine (JVM). It describes how the JVM uses threads, a stack, heap, and method area. It explains JVM control flow through bytecode instructions like goto, and how the operand stack is used to perform operations and hold method arguments and return values.
Compiler Construction | Lecture 9 | Constraint ResolutionEelco Visser
This document provides an overview of constraint resolution in the context of a compiler construction lecture. It discusses unification, which is the basis for many type inference and constraint solving approaches. It also describes separating type checking into constraint generation and constraint solving, and introduces a constraint language that integrates name resolution into constraint resolution through scope graph constraints. Finally, it discusses papers on further developments with this approach, including addressing expressiveness and staging issues in type systems through the Statix DSL for defining type systems.
Compiler Construction | Lecture 8 | Type ConstraintsEelco Visser
This lecture covers type checking with constraints. It introduces the NaBL2 meta-language for writing type specifications as constraint generators that map a program to constraints. The constraints are then solved to determine if a program is well-typed. NaBL2 supports defining name binding and type structures through scope graphs and constraints over names, types, and scopes. Examples show type checking patterns in NaBL2 including variables, functions, records, and name spaces.
Compiler Construction | Lecture 7 | Type CheckingEelco Visser
This document summarizes a lecture on type checking. It discusses using constraints to separate the language-specific type checking rules from the language-independent solving algorithm. Constraint-based type checking collects constraints as it traverses the AST, then solves the constraints in any order. This allows type information to be learned gradually and avoids issues with computation order.
Compiler Construction | Lecture 6 | Introduction to Static AnalysisEelco Visser
Lecture introducing the need for static analysis in addition to parsing, the complications caused by names, and an introduction to name resolution with scope graphs
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesQuickdice ERP
Explore the seamless transition to e-invoicing with this comprehensive guide tailored for Saudi Arabian businesses. Navigate the process effortlessly with step-by-step instructions designed to streamline implementation and enhance efficiency.
Transform Your Communication with Cloud-Based IVR SolutionsTheSMSPoint
Discover the power of Cloud-Based IVR Solutions to streamline communication processes. Embrace scalability and cost-efficiency while enhancing customer experiences with features like automated call routing and voice recognition. Accessible from anywhere, these solutions integrate seamlessly with existing systems, providing real-time analytics for continuous improvement. Revolutionize your communication strategy today with Cloud-Based IVR Solutions. Learn more at: https://thesmspoint.com/channel/cloud-telephony
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Mobile app Development Services | Drona InfotechDrona Infotech
Drona Infotech is one of the Best Mobile App Development Company In Noida Maintenance and ongoing support. mobile app development Services can help you maintain and support your app after it has been launched. This includes fixing bugs, adding new features, and keeping your app up-to-date with the latest
Visit Us For :
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfVALiNTRY360
Salesforce Healthcare CRM, implemented by VALiNTRY360, revolutionizes patient management by enhancing patient engagement, streamlining administrative processes, and improving care coordination. Its advanced analytics, robust security, and seamless integration with telehealth services ensure that healthcare providers can deliver personalized, efficient, and secure patient care. By automating routine tasks and providing actionable insights, Salesforce Healthcare CRM enables healthcare providers to focus on delivering high-quality care, leading to better patient outcomes and higher satisfaction. VALiNTRY360's expertise ensures a tailored solution that meets the unique needs of any healthcare practice, from small clinics to large hospital systems.
For more info visit us https://valintry360.com/solutions/health-life-sciences
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
3. Unification
3
Baader, F., and W. Snyder
"Unification Theory”
Ch. 8 of Handbook of Automated Deduction
Springer Verlag, Berlin (2001)
http://www.cs.bu.edu/~snyder/publications/UnifChapter.pdf
18. Set Representatives
6
FIND(a):
b := rep(a)
if b == a:
return a
else
return FIND(b)
UNION(a1,a2):
b1 := FIND(a1)
b2 := FIND(a2)
LINK(b1,b2)
LINK(a1,a2):
rep(a1) := a2
a == b
c == a
u == w
v == u
x == v
x == c
a
b c
u
w v
x
25. Path Compression
7
FIND(a):
b := rep(a)
if b == a:
return a
else
b := FIND(b)
rep(a) := b
return b
UNION(a1,a2):
b1 := FIND(a1)
b2 := FIND(a2)
LINK(b1,b2)
LINK(a1,a2):
rep(a1) := a2
…
x == b
x == c
x == w
x == v
a
b c
u
w v
x
37. Tree Balancing
8
FIND(a):
b := rep(a)
if b == a:
return a
else
b := FIND(b)
rep(a) := b
return b
UNION(a1,a2):
b1 := FIND(a1)
b2 := FIND(a2)
LINK(b1,b2)
LINK(a1,a2):
if size(a2) > size(a1):
rep(a1) := a2
size(a2) += size(a1)
else:
rep(a2) := a1
size(a1) += size(a2)
…
x == c
a
b c
u
w v
x
1
21
4
11
3
54. Main idea
- Represent unifier as graph
- One variable represent equivalence class
- Replace substitution by union & find operations
- Testing equality becomes testing node identity
Optimizations
- Path compression make recurring lookups fast
- Tree balancing keeps paths short
Complexity
- Linear in space and almost linear in time (technically inverse Ackermann)
- Easy to extract triangular unifier from graph
- Postpone occurrence checks to prevent traversing (potentially) large terms
Union-Find
10
Martelli, Montanari. An Efficient Unification Algorithm. TOPLAS, 1982
56. Type errors
- Types are supposed to prevent us from making mistakes
- Error messages are supposed to help us fix mistakes
- This does not always work out so well
‣ Wrong error location
‣ Unclear error message
‣ Not always clear where inferred types come from
- Users expect concise, informative messages, at the right place
Type errors = Unsatisfiable constraints
- Constraint satisfaction is a binary property
- Language designers want to influence error messages
Reporting Type Errors
12
78. Conflict Sets
14
1. let
2. function f(x) =
3. x + 1
4. in
5. (f "Hello!") * 2
ty1 == FUN(ty2, ty3)
ty2 == INT()
ty3 == INT()
ty1 == FUN(ty4, ty5)
ty4 == STRING()
ty5 == INT()
[function f(x)]
[x + _]
[_ + _]
[f _]
[“Hello!”]
[_ * 2]
ty1 == FUN(ty2, ty3)
ty2 == INT()
ty3 == INT()
ty1 == FUN(ty4, ty5)
ty4 == STRING()
ty5 == INT()
ty1 == FUN(ty2, ty3)
ty2 == INT()
ty1 == FUN(ty4, ty5)
ty4 == STRING()
A conflict set is an inconsistent subset of the constraint set
79. Conflict Sets
- Sets of constraint that are inconsistent together
- Multiple conflict sets might appear in one constraint set
- Conflict sets can intersect
How to find conflict sets?
- Find minimal sets that are in conflict
‣ Combinatorial explosion (Min-SAT)
- Approximate conflict sets during constraint solving
‣ Conflict set may be too large
Where to report errors?
- Report the conflicting program slice
(using all conflicting constraints)
- Report on a few constraints in the conflict set
‣ Remove constraints until inconsistency disappears
‣ Use heuristics to efficiently select constraints
There is not always a best place to report the error!
Conflict Sets and Errors
15
1. let
2. function f(x) =
3. x + 1
4. in
5. (f "Hello!") * 2
96. Use approximated conflict sets
17
1. ty1 == FUN(ty2, ty3)
2. ty2 == INT()
3. ty3 == INT()
4. ty1 == FUN(ty4, ty5)
5. ty4 == STRING()
6. ty5 == INT()
Loncaric e.a. A practical framework for type inference error explanation. OOPSLA’16
ty1
ty2
ty3
ty4
ty5 INT()
FUN(ty2, ty3)
- Track constraints during
unification
INT()
1
2
3
1,4
1,4
FIND(ty4) = INT() because of {1,2,4}
97. Use approximated conflict sets
17
1. ty1 == FUN(ty2, ty3)
2. ty2 == INT()
3. ty3 == INT()
4. ty1 == FUN(ty4, ty5)
5. ty4 == STRING()
6. ty5 == INT()
Loncaric e.a. A practical framework for type inference error explanation. OOPSLA’16
ty1
ty2
ty3
ty4
ty5 INT()
FUN(ty2, ty3)
- Track constraints during
unification
INT()
1
2
3
1,4
1,4
FIND(ty4) = INT() because of {1,2,4}
constraint 5 gives conflict set {1,2,4,5}
98. Use approximated conflict sets
17
1. ty1 == FUN(ty2, ty3)
2. ty2 == INT()
3. ty3 == INT()
4. ty1 == FUN(ty4, ty5)
5. ty4 == STRING()
6. ty5 == INT()
Loncaric e.a. A practical framework for type inference error explanation. OOPSLA’16
ty1
ty2
ty3
ty4
ty5 INT()
FUN(ty2, ty3)
- Track constraints during
unification
- Conflict set may be an
over-approximation
INT()
1
2
3
1,4
1,4
FIND(ty4) = INT() because of {1,2,4}
constraint 5 gives conflict set {1,2,4,5}
99. Use approximated conflict sets
17
1. ty1 == FUN(ty2, ty3)
2. ty2 == INT()
3. ty3 == INT()
4. ty1 == FUN(ty4, ty5)
5. ty4 == STRING()
6. ty5 == INT()
Loncaric e.a. A practical framework for type inference error explanation. OOPSLA’16
ty1
ty2
ty3
ty4
ty5 INT()
FUN(ty2, ty3)
- Track constraints during
unification
- Conflict set may be an
over-approximation
- Iteratively drop constraints
until inconsistency is gone
INT()
1
2
3
1,4
1,4
FIND(ty4) = INT() because of {1,2,4}
constraint 5 gives conflict set {1,2,4,5}
100. Use approximated conflict sets
17
1. ty1 == FUN(ty2, ty3)
2. ty2 == INT()
3. ty3 == INT()
4. ty1 == FUN(ty4, ty5)
5. ty4 == STRING()
6. ty5 == INT()
Loncaric e.a. A practical framework for type inference error explanation. OOPSLA’16
ty1
ty2
ty3
ty4
ty5 INT()
FUN(ty2, ty3)
- Track constraints during
unification
- Conflict set may be an
over-approximation
- Iteratively drop constraints
until inconsistency is gone
- Solver is used as an oracle,
no requirements on its
implementation
INT()
1
2
3
1,4
1,4
FIND(ty4) = INT() because of {1,2,4}
constraint 5 gives conflict set {1,2,4,5}
101. Error reporting from conflict sets
- Select constraints that are likely causes
- Few error messages is usually preferred over many
- Avoid combinatorial explosion by using heuristics
Language independent heuristics
- Select constraints shared between multiple conflict sets
- Select constraints coming from smaller program fragments
‣ Function definition type comes from the (larger) body expression
‣ Function use type comes from the (smaller) use expression
Language specific heuristics
- Select constraint based on weights assigned in specification
‣ Assign more weight to constraints from definitions, than constraints from use
- Select constraints with explicit error messages
‣ Avoids reporting on implicit equalities that arise during constraint generation
Which constraint is to blame?
18
102. Requirements on the solver
- Report (approximated) conflict sets
‣ Conflict sets should be over-approximations
‣ The closer to the minimal conflict set, the better
- Fast failure is important
‣ Solver is called repeatedly with smaller constraint sets
How to report errors?
- Reporting ‘<long function type> expected, but got <long but
slightly different function type>’ can be improved
- Can we report that first argument is different, or that number of
arguments is different?
More Aspects
19
105. Unification with Union-Find
- Represent unifier as a graph
- Testing term equality becomes testing node identity
- Really fast with path compression and tree balancing
Error Reporting
- Selecting constraints to report errors on
- Use conflict sets to find cause of inconsistencies
- Report on
‣ all conflicting constraints (program slice)
‣ subset of constraints that removes inconsistency
- Use heuristics to select constraints to blame
Summary
22