Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M4GB implementation #7

Draft
wants to merge 60 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a8bb7d7
Experimental implementation of M4GB
konn Jan 26, 2020
fff671b
Updates stack.yaml and CI
konn Feb 1, 2020
f66baf6
GIT_STRATEGY
konn Feb 1, 2020
e278531
Untracks every LFS files
konn Feb 1, 2020
3edf172
Stop using LFS
konn Feb 2, 2020
ce55d22
Workaround for Ubuntu version difference
konn Feb 2, 2020
44dbe92
Fixes version revisions
konn Feb 2, 2020
7a70352
Corrects nightly
konn Feb 2, 2020
4522f5a
Updates stack version constraints
konn Feb 2, 2020
d7abd3d
Corrects version range
konn Feb 2, 2020
ab00473
Fixes version range
konn Feb 2, 2020
e417a65
[ci skip] misc change
konn Feb 2, 2020
1946abf
Workaround for singletons 2.6
konn Feb 2, 2020
888aa69
Updates `tested-with`
konn Feb 2, 2020
4b18e84
ci: caches each `.stack-work` in subdirs as well
konn Feb 2, 2020
fb293dc
ci: corrects yaml
konn Feb 2, 2020
d65f61a
Corrects test-cases to specify coefficient
konn Feb 2, 2020
84c1cd0
Builds test-cases in build phase
konn Feb 2, 2020
739187f
Good bye GHC 8.2
konn Feb 2, 2020
dacf943
[ci skip] Adds a reference to the paper
konn Feb 5, 2020
b6cc8ed
Updates stackyaml
konn Feb 9, 2020
7c2ac45
Switches to LTS-15.0 for GHC 8.8
konn Feb 17, 2020
8b2b9bf
HIE.yaml
konn Jun 20, 2020
d4ee176
Fixes package.yaml duplicated key
konn Jun 20, 2020
9941be2
Corrects the polyToVec definition of Galois field
konn Jun 20, 2020
68f0f3b
factorise: Workaround for non-monic polynomials
konn Jun 20, 2020
9e6202a
Simplifies leadMonom
konn Jun 20, 2020
41b56a5
Corrects the definition of negate
konn Jun 20, 2020
f2b92df
import Algebra.Prelude instead of :l
konn Jun 20, 2020
9d62ca3
More efficient trace polynomial computation
konn Jun 20, 2020
4194495
Adds remindering by f in for equal-degree splitting during evaluating…
konn Jun 20, 2020
1a36d66
coefficient handling
konn Jun 20, 2020
4ede3af
Workaround for GHC <= 8.4
konn Jun 20, 2020
745bb5b
[ci skip] adds TypeApplications to GHCi flag
konn Jun 21, 2020
c290d33
Docker files
konn Jun 21, 2020
8243aad
Dockerfiles for version-wise build
konn Jun 21, 2020
0afc00a
ci: Changes to use custom docker images to save building time
konn Jun 21, 2020
6e8a9a9
ci: LLVM fix
konn Jun 30, 2020
149c677
Changes cache keys
konn Jun 30, 2020
64654a6
No .stack-root hack
konn Jun 30, 2020
c175ae1
Implements factorisation test-cases
konn Jun 30, 2020
a6d5d74
Updates hie.yaml
konn Jun 30, 2020
ed99dce
Failing unit-test
konn Jun 30, 2020
cfdda25
Allow GHC 8.4 to fail
konn Jun 30, 2020
62251a0
Restructures regression tests and adds simple test-cases for squareFr…
konn Jun 30, 2020
9eca650
Utility functions for univariate polynomials
konn Jul 2, 2020
52dd241
Import-lists
konn Jul 2, 2020
18ee5eb
Entire overhaul and debug on square-free decomposition
konn Jul 2, 2020
1c097ec
[ci skip] Dockefile update
konn Jul 3, 2020
855ed31
[ci skip] stack-setup
konn Jul 3, 2020
94b36b0
ci: Updates docker image
konn Jul 3, 2020
3000896
Corrects hie,yaml
konn Jul 4, 2020
b55d8c9
Changes specs name
konn Jul 4, 2020
d36261e
Removes dead code fragment
konn Jul 4, 2020
1689d7f
Restricts maximum success number
konn Jul 4, 2020
abcc926
singletons-presburger
konn Jul 4, 2020
624c0cb
Refactors and adds regressions to ZeroDimSpec
konn Jul 4, 2020
40b35a7
Corrects implementation of `subspMatrix`
konn Jul 4, 2020
6362da9
Refactors test-cases
konn Jul 4, 2020
8cac902
Updates ci images
konn Jul 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.stack-work
.DS_Store
Dockerfile
.git
**/.stack-work
profiling-results
bench-results
_site
_cache
gh-pages-devel
*.aux
*.hp
*.pdf
*.ps
4 changes: 2 additions & 2 deletions .ghci
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:set -XFlexibleContexts -XFlexibleInstances
:set -XUndecidableInstances -XRebindableSyntax
:set -XOverloadedLabels -XNoImplicitPrelude
:set -XQuasiQuotes -XScopedTypeVariables
:l Algebra.Prelude
:set -XQuasiQuotes -XScopedTypeVariables -XTypeApplications
import Algebra.Prelude
:set -ishare -itests -ibench
:set prompt "ghci> "
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
**/*.pdf filter=lfs diff=lfs merge=lfs -text
**/*.ps filter=lfs diff=lfs merge=lfs -text
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,12 @@ profiling-results
**/*-prof.ps
stack*.yaml.lock
**/*.cabal
### https://raw.github.com/github/gitignore/f9291de89f5f7dc0d3d87f9eb111b839f81d5dbc/Global/VisualStudioCode.gitignore

.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json


Expand Down
114 changes: 38 additions & 76 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
image: fpco/stack-build:lts-12.2
image: registry.gitlab.com/konn/computational-algebra/build-pre:0.6.0.0-p1

variables:
GIT_STRATEGY: fetch

stages:
- build
Expand All @@ -7,141 +10,100 @@ stages:

.cached_dirs: &cached-dirs
paths:
- .stack-work/
- .stack-root/
- .apt/
- .hspec-failures

.header-ghc-80: &header-ghc-80
variables:
STACK_YAML: "stack-800.yaml"
cache:
key: ghc-8.0
<<: *cached-dirs

.header-ghc-82: &header-ghc-82
variables:
STACK_YAML: "stack-802.yaml"
cache:
key: ghc-8.2
<<: *cached-dirs
- '.stack-work/'
- '.stack-root/'
- '*/.stack-work'
- '.apt/'
- '.hspec-failures'

.header-ghc-84: &header-ghc-84
image: registry.gitlab.com/konn/computational-algebra/build/ghc-8.4:0.6.0.0-p3
allow_failure: true
variables:
STACK_YAML: "stack-804.yaml"
GHC: 804
cache:
key: ghc-8.4
key: "${CI_COMMIT_REF_SLUG}-ghc-8.4"
<<: *cached-dirs

.header-ghc-86: &header-ghc-86
image: registry.gitlab.com/konn/computational-algebra/build/ghc-8.6:0.6.0.0-p2
variables:
STACK_YAML: "stack-806.yaml"
allow_failure: true
GHC: 806
cache:
key: "${CI_COMMIT_REF_SLUG}-ghc-8.6"
<<: *cached-dirs

.header-ghc-88: &header-ghc-88
image: registry.gitlab.com/konn/computational-algebra/build/ghc-8.8:0.6.0.0-p2
variables:
STACK_YAML: "stack-808.yaml"
GHC: 808
cache:
key: ghc-8.6
key: "${CI_COMMIT_REF_SLUG}-ghc-8.8"
<<: *cached-dirs

before_script:
- echo $CI_PROJECT_DIR
- export STACK_ROOT="${CI_PROJECT_DIR}/.stack-root"
- export PATH="$HOME/.local/bin:$PATH"
- export APT_DIR=$CI_PROJECT_DIR/.apt
- export APT_STATE_LISTS=$APT_DIR/lists
- export APT_CACHE_ARCHIVES=$APT_DIR/archives
- printf "dir::state::lists ${APT_STATE_LISTS};\ndir::cache::archives ${APT_CACHE_ARCHIVES};\n" > /etc/apt/apt.conf
- mkdir -p "${APT_STATE_LISTS}/partial" && mkdir -p "${APT_CACHE_ARCHIVES}/partial"
- apt-get update -y -qq && apt-get install -y -qq wget
- wget ftp://jim.mathematik.uni-kl.de/repo/extra/gpg && apt-key add gpg && rm gpg
- echo "deb ftp://jim.mathematik.uni-kl.de/repo/ubuntu16 xenial main" >> /etc/apt/sources.list
- apt-get update -y -qq
- apt-get install -y -qq singular41 libgmp3-dev libgsl0-dev liblapack-dev
- stack upgrade
- stack setup
- export LD_LIBRARY_PATH="$(dirname $(stack path --global-pkg-db))/rts:$LD_LIBRARY_PATH"

.build-script: &build-script
stage: build
script:
- |
if [ -d ${STACK_ROOT} ]; then
echo "Already exists: ${STACK_ROOT}";
ls "$STACK_ROOT";
else
echo "No stack-root. copying fpco..."
cp -r /root/.stack $STACK_ROOT;
fi
- stack --version
- echo "$STACK_YAML"
- stack setup
- stack build --no-terminal --only-dependencies
- stack build --no-terminal
- stack build --no-terminal --test --no-run-tests --only-dependencies --coverage
- stack build --no-terminal --test --no-run-tests --coverage

.test-script: &test-script
stage: test
script:
- stack setup
- stack --no-terminal test --no-rerun-tests --coverage

build:ghc-8.0:
image: fpco/stack-build:lts-9.5
<<: *header-ghc-80
<<: *build-script

build:ghc-8.2:
image: fpco/stack-build:lts-11.4
<<: *header-ghc-82
<<: *build-script

build:ghc-8.4:
image: fpco/stack-build:lts-12.2
<<: *header-ghc-84
<<: *build-script

build:ghc-8.6:
image: fpco/stack-build:lts-12.10
<<: *header-ghc-86
<<: *build-script

test:ghc-8.0:
image: fpco/stack-build:lts-9.5
dependencies:
- build:ghc-8.0
<<: *header-ghc-80
<<: *test-script

test:ghc-8.2:
image: fpco/stack-build:lts-11.4
dependencies:
- build:ghc-8.2
<<: *header-ghc-82
<<: *test-script
build:ghc-8.8:
<<: *header-ghc-88
<<: *build-script

test:ghc-8.4:
image: fpco/stack-build:lts-12.2
dependencies:
- build:ghc-8.4
<<: *header-ghc-84
<<: *test-script
coverage: '/^\s*(\d+\s*%)\s*top-level declarations used/'

test:ghc-8.6:
image: fpco/stack-build:lts-12.10
dependencies:
- build:ghc-8.6
<<: *header-ghc-86
<<: *test-script

test:ghc-8.8:
dependencies:
- build:ghc-8.8
<<: *header-ghc-88
<<: *test-script

deploy_documents:
only:
- master@konn/computational-algebra
image: fpco/stack-build:lts-12.2
image: registry.gitlab.com/konn/computational-algebra/build/ghc-8.6:0.6.0.0-p2
stage: deploy
allow_failure: true
dependencies:
- test:ghc-8.4
- test:ghc-8.6
cache:
key: ghc-8.4
key: "${CI_COMMIT_REF_SLUG}-ghc-8.6"
policy: pull
<<: *cached-dirs
script:
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"editor.tabCompletion": "onlySnippets"
"editor.tabCompletion": "onlySnippets",
"files.exclude": {
"heap-poly": true
}
}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,11 @@ $ stack build
In addition, you may need to install GSL and LAPACK (for matrix computation) beforehand.
You can install them via Homebrew (OS X), `apt-get`, or other major package management systems.

Paper
-----
* Hiromi Ishii, _A Purely Functional Computer Algebra System Embedded in Haskell_.
Computer Algebra in Scientific Computing, pp. 288-303. 20th International Workshop, CASC 2018, Lille, France, September 17-21, 2018, Proceedings ([arXiv][arXiv]).

### [Read More in Official Project Site](http://konn.github.io/computational-algebra/)

[arXiv]: https://arxiv.org/abs/1807.01456
3 changes: 1 addition & 2 deletions computational-algebra/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ extra-source-files:
- ChangeLog.md

tested-with: |
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3
GHC == 8.4.3, GHC == 8.6.5, GHC == 8.8.2

# Metadata used when publishing your package
# synopsis: Short description of your package
category: Math

description: Please see the project Web Site at <https://konn.github.io/computational-algebra>

github: konn/computational-algebra

flags:
examples:
Expand Down
15 changes: 15 additions & 0 deletions dockerfiles/build-pre/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM fpco/stack-build:lts-14.20
ARG LTS=lts-14.20
ARG GHC_LLVM_LLC_PATH=llc-6.0
ARG GHC_LLVM_OPT_PATH=opt-6.0

ENV PATH /root/.local/bin:$PATH
ENV LD_LIBRARY_PATH $MPI/lib:$LD_LIBRARY_PATH

RUN apt-get update -y -qq && apt-get install -y -qq wget
RUN wget ftp://jim.mathematik.uni-kl.de/repo/extra/gpg && apt-key add gpg && rm gpg
RUN echo "deb ftp://jim.mathematik.uni-kl.de/repo/ubuntu18 bionic main" >> /etc/apt/sources.list
RUN apt-get update -y -qq
RUN apt-get install -y -qq singular41 libgmp3-dev libgsl0-dev liblapack-dev
RUN stack upgrade

29 changes: 29 additions & 0 deletions dockerfiles/build/ghc-8.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM registry.gitlab.com/konn/computational-algebra/build-pre:0.6.0.0

RUN mkdir /skeleton
COPY computational-algebra/ /skeleton/computational-algebra
COPY algebraic-prelude/ /skeleton/algebraic-prelude
COPY halg-algebraic/ /skeleton/halg-algebraic
COPY halg-algorithms/ /skeleton/halg-algorithms
COPY halg-bridge-singular/ /skeleton/halg-bridge-singular
COPY halg-core/ /skeleton/halg-core
COPY halg-core-test/ /skeleton/halg-core-test
COPY halg-factor/ /skeleton/halg-factor
COPY halg-galois-fields/ /skeleton/halg-galois-fields
COPY halg-heaps/ /skeleton/halg-heaps
COPY halg-matrices/ /skeleton/halg-matrices
COPY halg-polyn-parser/ /skeleton/halg-polyn-parser
COPY halg-polynomials/ /skeleton/halg-polynomials

ENV GHC=804
COPY stack-${GHC}.yaml /skeleton

WORKDIR /skeleton
ENV STACK_YAML=stack-${GHC}.yaml
RUN stack setup
RUN stack build --only-dependencies --test --no-run-tests

ENV GHC_LLVM_LLC_PATH=llc-5.0
ENV GHC_LLVM_OPT_PATH=opt-5.0

RUN echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main" >> /etc/apt/sources.list && wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - && apt-get update && apt-get -y install clang-5.0 lld-5.0
24 changes: 24 additions & 0 deletions dockerfiles/build/ghc-8.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM registry.gitlab.com/konn/computational-algebra/build-pre:0.6.0.0

RUN mkdir /skeleton
COPY computational-algebra/ /skeleton/computational-algebra
COPY algebraic-prelude/ /skeleton/algebraic-prelude
COPY halg-algebraic/ /skeleton/halg-algebraic
COPY halg-algorithms/ /skeleton/halg-algorithms
COPY halg-bridge-singular/ /skeleton/halg-bridge-singular
COPY halg-core/ /skeleton/halg-core
COPY halg-core-test/ /skeleton/halg-core-test
COPY halg-factor/ /skeleton/halg-factor
COPY halg-galois-fields/ /skeleton/halg-galois-fields
COPY halg-heaps/ /skeleton/halg-heaps
COPY halg-matrices/ /skeleton/halg-matrices
COPY halg-polyn-parser/ /skeleton/halg-polyn-parser
COPY halg-polynomials/ /skeleton/halg-polynomials

ENV GHC=806
COPY stack-${GHC}.yaml /skeleton

WORKDIR /skeleton
ENV STACK_YAML=stack-${GHC}.yaml
RUN stack setup
RUN stack build --only-dependencies --test --no-run-tests
24 changes: 24 additions & 0 deletions dockerfiles/build/ghc-8.8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM registry.gitlab.com/konn/computational-algebra/build-pre:0.6.0.0

RUN mkdir /skeleton
COPY computational-algebra/ /skeleton/computational-algebra
COPY algebraic-prelude/ /skeleton/algebraic-prelude
COPY halg-algebraic/ /skeleton/halg-algebraic
COPY halg-algorithms/ /skeleton/halg-algorithms
COPY halg-bridge-singular/ /skeleton/halg-bridge-singular
COPY halg-core/ /skeleton/halg-core
COPY halg-core-test/ /skeleton/halg-core-test
COPY halg-factor/ /skeleton/halg-factor
COPY halg-galois-fields/ /skeleton/halg-galois-fields
COPY halg-heaps/ /skeleton/halg-heaps
COPY halg-matrices/ /skeleton/halg-matrices
COPY halg-polyn-parser/ /skeleton/halg-polyn-parser
COPY halg-polynomials/ /skeleton/halg-polynomials

ENV GHC=808
COPY stack-${GHC}.yaml /skeleton

WORKDIR /skeleton
ENV STACK_YAML=stack-${GHC}.yaml
RUN stack setup
RUN stack build --only-dependencies --test --no-run-tests
2 changes: 1 addition & 1 deletion halg-algebraic/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extra-source-files:
- ChangeLog.md

tested-with: |
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3
GHC == 8.4.3, GHC == 8.6.5, GHC == 8.8.2

# Metadata used when publishing your package
synopsis: Algebraic reals, part of halg computational algebra suite.
Expand Down
6 changes: 4 additions & 2 deletions halg-algorithms/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extra-source-files:
- ChangeLog.md

tested-with: |
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3
GHC == 8.4.3, GHC == 8.6.5, GHC == 8.8.2

# Metadata used when publishing your package
synopsis: Algorithms related to Gröbner basis, part of halg computational algebra suite.
Expand Down Expand Up @@ -112,7 +112,7 @@ executables:
<<: *prof-settings

tests:
spec:
halg-algorithms-specs:
main: Spec.hs
source-dirs: test
ghc-options:
Expand All @@ -128,6 +128,8 @@ tests:
- ghc-typelits-knownnat
- halg-core-test
- halg-polynomials
- singletons-presburger
- singletons
- halg-algorithms
- halg-bridge-singular
- QuickCheck
Expand Down
Loading