Commit 50812b14 authored by Michal Terepeta's avatar Michal Terepeta

Remove fibon

Summary:
It doesn't compile, nobody is running it and upstream seems to have
abandoned it too. IMHO, at this point we should simply remove it and
focus on improving the benchmarks that do work & adding new ones.

See also the discussion in #11501
Signed-off-by: Michal Terepeta's avatarMichal Terepeta <michal.terepeta@gmail.com>

Test Plan: compile & run nofib

Reviewers: bgamari

Subscribers:
parent 88ebedd4

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
This diff is collapsed.
2010-06-21 John D. Ramsdell <ramsdell@mitre.org>
* agum.cabal (Version): Released as version 2.3.
* agum.cabal (Build-Depends): changes dependency to
base >= 3 && <5, containers
2009-09-17 John D. Ramsdell <ramsdell@mitre.org>
* agum.cabal (Version): Released as version 2.2.
2009-09-14 John D. Ramsdell <ramsdell@.mitre.org>
* src/Algebra/AbelianGroup/IntLinEq.hs: Integer solutions to
linear equation solver was placed in its own module.
2009-09-13 John D. Ramsdell <ramsdell@mitre.org>
* src/Algebra/AbelianGroup/UnificationMatching.hs (unify): Changed
the result to be a substitution since unification always succeeds.
2009-09-05 John D. Ramsdell <ramsdell@mitre.org>
* src/Algebra/AbelianGroup/UnificationMatching.hs: Added
reference to Andrew Kennedy's Ph.D. thesis as it contains a proof
of correctness of the implemented matching algorithm.
* agum.cabal (Version): Released as version 2.1.
2009-08-29 John D. Ramsdell <ramsdell@mitre.org>
* src/Algebra/AbelianGroup/UnificationMatching.hs (Substitution,
apply): Hid the representation of a substitution and supplied a
function for applying a substitution to a term.
* agum.cabal (Version): Released as version 2.0.
TOP = ../../..
include $(TOP)/mk/boilerplate.mk
SRCS = src/Algebra/AbelianGroup/IntLinEq.hs \
src/Algebra/AbelianGroup/UnificationMatching.hs \
src/Algebra/AbelianGroup/Main.hs
STDIN_FILE = eqn.txt
HC_OPTS += -isrc -package base -package containers
include $(TOP)/mk/target.mk
This diff is collapsed.
This diff is collapsed.
This package contains a library for unification and matching in
an Abelian group and a program that exercises the library.
$ agum
Abelian group unification and matching -- :? for help
agum> 2x+y=3z
Problem: 2x + y = 3z
Unifier: [x : g0,y : -2g0 + 3g2,z : g2]
Matcher: [x : g0,y : -2g0 + 3z]
agum> 2x=x+y
Problem: 2x = x + y
Unifier: [x : g1,y : g1]
Matcher: no solution
agum> 64x-41y=a
Problem: 64x - 41y = a
Unifier: [a : 64g1 - 41g2,x : g1,y : g2]
Matcher: [x : -16a - 41g6,y : -25a - 64g6]
agum> :quit
-- Integer Solutions of Linear Inhomogeneous Equations
--
-- Copyright (C) 2009 John D. Ramsdell
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
-- |
-- Module : Algebra.AbelianGroup.IntLinEq
-- Copyright : (C) 2009 John D. Ramsdell
-- License : GPL
--
-- Integer Solutions of Linear Inhomogeneous Equations
--
-- A linear equation with integer coefficients is represented as a
-- pair of lists of non-zero integers, the coefficients and the
-- constants. If there are no constants, the linear equation
-- represented by (c, []) is the homogeneous equation:
--
-- > c[0]*x[0] + c[1]*x[1] + ... + c[n-1]*x[n-1] = 0
--
-- where n is the length of c. Otherwise, (c, d) represents the
-- inhomogeneous equation:
--
-- > c[0]*x[0] + c[1]*x[1] + ... + c[n-1]*x[n-1] = g
--
-- where g = gcd(d[0], d[1], ..., d[m-1]), and m is the length of d.
-- Thus g is the greatest common denominator of the elements of d.
--
-- A solution is a partial map from variables to terms, and a term is
-- a pair of lists of integers, the variable part of the term followed
-- by the constant part. The variable part may specify variables not
-- in the input. In other words, the length of the coefficents in the
-- answer may exceed the length of the coefficients in the input. For
-- example, the solution of
--
-- > 64x - 41y = 1
--
-- is x = -41z - 16 and y = -64z - 25. The computed solution is read
-- off the list returned as an answer.
--
-- > intLinEq [64,-41] [1] =
-- > [(0,([0,0,0,0,0,0,-41],[-16])),
-- > (1,([0,0,0,0,0,0,-64],[-25]))]
--
-- The algorithm used to find solutions is described in Vol. 2 of The
-- Art of Computer Programming \/ Seminumerical Alorithms, 2nd Ed.,
-- 1981, by Donald E. Knuth, pg. 327. To show sums, we write
--
-- > sum[i] c[i]*x[i] for c[0]*x[0] + c[1]*x[1] + ... + c[n-1]*x[n-1].
--
-- The algorithm's initial values are the linear equation (c,d) and an
-- empty substitution s.
--
-- 1. Let c[i] be the smallest non-zero coefficient in absolute value.
--
-- 2. If c[i] < 0, multiply c and d by -1 and goto step 1.
--
-- 3. If c[i] = 1, a general solution of the following form has been
-- found:
--
-- > x[i] = sum[j] -c'[j]*x[j] + d[k] for all k
--
-- where c' is c with c'[i] = 0. Use the equation to eliminate x[i]
-- from the range of the current substitution s. If variable x[i] is
-- in the original equation, add the mapping to substitution s.
--
-- 4. If c[i] divides every coefficient in c,
--
-- * if c[i] divides every constant in d, divide c and d by c[i]
-- and goto step 3,
--
-- * otherwise fail because there is no solution.
--
-- 5. Otherwise, eliminate x[i] as above in favor of freshly created
-- variable x[n], where n is the length of c.
--
-- > x[n] = sum[j] (c[j] div c[i] * x[j])
--
-- Goto step 1 and solve the equation:
--
-- > c[i]*x[n] + sum[j] (c[j] mod c[i])*x[j] = d[k] for all k
module Algebra.AbelianGroup.IntLinEq
(LinEq, Subst, intLinEq) where
-- | A linear equation with integer coefficients is represented as a
-- pair of lists of non-zero integers, the coefficients and the
-- constants.
type LinEq = ([Int], [Int])
-- | A solution to a linear equation is a partial map from variables
-- to terms, and a term is a pair of lists of integers, the variable
-- part of the term followed by the constant part. The variable part
-- may specify variables not in the input. In other words, the length
-- of the coefficents in the answer may exceed the length of the
-- coefficients in the input.
type Subst = [(Int, LinEq)]
-- | Find integer solutions to a linear equation or fail when there
-- are no solutions.
intLinEq :: Monad m => LinEq -> m Subst
intLinEq (coefficients, constants) =
intLinEqLoop (length coefficients) (coefficients, constants) []
-- The algorithm used to find solutions is described in Vol. 2 of The
-- Art of Computer Programming / Seminumerical Alorithms, 2nd Ed.,
-- 1981, by Donald E. Knuth, pg. 327.
-- On input, n is the number of variables in the original problem, c