Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE
ghc-ersatz
ghc-ersatz.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ghc-ersatz.spec of Package ghc-ersatz
# # spec file for package ghc-ersatz # # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %global pkg_name ersatz %bcond_with tests Name: ghc-%{pkg_name} Version: 0.4 Release: 0 Summary: A monad for expressing SAT or QSAT problems using observable sharing License: BSD-3-Clause Group: Development/Languages/Other Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz BuildRequires: chrpath BuildRequires: ghc-Cabal-devel BuildRequires: ghc-array-devel BuildRequires: ghc-attoparsec-devel BuildRequires: ghc-bytestring-devel BuildRequires: ghc-cabal-doctest-devel BuildRequires: ghc-containers-devel BuildRequires: ghc-data-default-devel BuildRequires: ghc-lens-devel BuildRequires: ghc-mtl-devel BuildRequires: ghc-parsec-devel BuildRequires: ghc-process-devel BuildRequires: ghc-rpm-macros BuildRequires: ghc-temporary-devel BuildRequires: ghc-transformers-devel BuildRequires: ghc-unordered-containers-devel BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %{with tests} BuildRequires: ghc-directory-devel BuildRequires: ghc-doctest-devel BuildRequires: ghc-filepath-devel %endif %description A monad for expressing SAT or QSAT problems using observable sharing. For example, we can express a full-adder with: > full_adder :: Bit -> Bit -> Bit -> (Bit, Bit) > full_adder a b cin = (s2, c1 || c2) > where (s1,c1) = half_adder a b > (s2,c2) = half_adder s1 cin > half_adder :: Bit -> Bit -> (Bit, Bit) > half_adder a b = (a `xor` b, a && b) /Longer Examples/ Included are a couple of examples included with the distribution. Neither are as fast as a dedicated solver for their respective domains, but they showcase how you can solve real world problems involving 10s or 100s of thousands of variables and constraints with `ersatz`. 'ersatz-sudoku' > % time ersatz-sudoku > Problem: > ┌───────┬───────┬───────┐ > │ 5 3 │ 7 │ │ > │ 6 │ 1 9 5 │ │ > │ 9 8 │ │ 6 │ > ├───────┼───────┼───────┤ > │ 8 │ 6 │ 3 │ > │ 4 │ 8 3 │ 1 │ > │ 7 │ 2 │ 6 │ > ├───────┼───────┼───────┤ > │ 6 │ │ 2 8 │ > │ │ 4 1 9 │ 5 │ > │ │ 8 │ 7 9 │ > └───────┴───────┴───────┘ > Solution: > ┌───────┬───────┬───────┐ > │ 5 3 4 │ 6 7 8 │ 9 1 2 │ > │ 6 7 2 │ 1 9 5 │ 3 4 8 │ > │ 1 9 8 │ 3 4 2 │ 5 6 7 │ > ├───────┼───────┼───────┤ > │ 8 5 9 │ 7 6 1 │ 4 2 3 │ > │ 4 2 6 │ 8 5 3 │ 7 9 1 │ > │ 7 1 3 │ 9 2 4 │ 8 5 6 │ > ├───────┼───────┼───────┤ > │ 9 6 1 │ 5 3 7 │ 2 8 4 │ > │ 2 8 7 │ 4 1 9 │ 6 3 5 │ > │ 3 4 5 │ 2 8 6 │ 1 7 9 │ > └───────┴───────┴───────┘ > ersatz-sudoku 1,13s user 0,04s system 99% cpu 1,179 total 'ersatz-regexp-grid' This solves the "regular crossword puzzle" (<https://github.com/ekmett/ersatz/raw/master/notes/grid.pdf grid.pdf>) from the 2013 MIT mystery hunt. > % time ersatz-regexp-grid "SPOILER" > ersatz-regexp-grid 2,45s user 0,05s system 99% cpu 2,502 total. %package devel Summary: Haskell %{pkg_name} library development files Group: Development/Libraries/Other Requires: %{name} = %{version}-%{release} Requires: ghc-compiler = %{ghc_version} Requires(post): ghc-compiler = %{ghc_version} Requires(postun): ghc-compiler = %{ghc_version} %description devel This package provides the Haskell %{pkg_name} library development files. %prep %setup -q -n %{pkg_name}-%{version} %build %ghc_lib_build %install %ghc_lib_install %ghc_fix_rpath %{pkg_name}-%{version} %check %cabal_test %post devel %ghc_pkg_recache %postun devel %ghc_pkg_recache %files -f %{name}.files %defattr(-,root,root,-) %doc LICENSE %{_bindir}/ersatz-regexp-grid %{_bindir}/ersatz-sudoku %dir %{_datadir}/%{pkg_name}-%{version} %dir %{_datadir}/%{pkg_name}-%{version}/data %dir %{_datadir}/%{pkg_name}-%{version}/data/dimacs %dir %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf %dir %{_datadir}/%{pkg_name}-%{version}/data/dimacs/blocksworld %dir %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bmc %dir %{_datadir}/%{pkg_name}-%{version}/data/dimacs/logistics %dir %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity %dir %{_datadir}/%{pkg_name}-%{version}/data/dimacs/phole %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/bf0432-007.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/bf1355-075.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/bf1355-638.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/bf2670-001.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/descr.html %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/ssa0432-003.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/ssa2670-130.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/ssa2670-141.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/ssa6288-047.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/ssa7552-038.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/ssa7552-158.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/ssa7552-159.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bf/ssa7552-160.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/blocksworld/anomaly.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/blocksworld/bw_large.a.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/blocksworld/bw_large.b.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/blocksworld/bw_large.c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/blocksworld/descr.html %{_datadir}/%{pkg_name}-%{version}/data/dimacs/blocksworld/huge.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/blocksworld/medium.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bmc/bmc-ibm-1.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bmc/bmc-ibm-2.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bmc/bmc-ibm-3.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bmc/bmc-ibm-4.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bmc/bmc-ibm-5.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/bmc/bmc-ibm-7.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/logistics/descr.html %{_datadir}/%{pkg_name}-%{version}/data/dimacs/logistics/logistics.a.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/logistics/logistics.b.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/logistics/logistics.c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/logistics/logistics.d.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/descr %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par16-1-c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par16-1.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par16-2-c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par16-2.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par16-3-c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par16-3.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par16-4-c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par16-4.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par16-5-c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par16-5.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par8-1-c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par8-1.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par8-2-c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par8-2.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par8-3-c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par8-3.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par8-4-c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par8-4.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par8-5-c.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/parity/par8-5.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/phole/descr.html %{_datadir}/%{pkg_name}-%{version}/data/dimacs/phole/hole6.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/phole/hole7.cnf %{_datadir}/%{pkg_name}-%{version}/data/dimacs/phole/hole8.cnf %files devel -f %{name}-devel.files %defattr(-,root,root,-) %doc AUTHORS.md CHANGELOG.md README.md examples %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor