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

Release/0.2.0 #57

Merged
merged 149 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
b1ad65e
chore: DIMACS parser's parse function
w-disaster Aug 14, 2023
a30355c
refactor: little changes
w-disaster Aug 14, 2023
1270bfe
smtlib
w-disaster Aug 14, 2023
7ee4843
Merge pull request #35 from Mala1180/main
Mala1180 Aug 16, 2023
252058a
chore: random branching
w-disaster Aug 16, 2023
efc7737
doc: add third backlog
Mala1180 Aug 16, 2023
d8d7339
feat: add sbt-assembly, fixed image in jar, modify README
Mala1180 Aug 16, 2023
b3fbd27
chore (green): unit propagation
w-disaster Aug 16, 2023
b830f98
chore: split dpll into multiple methods
w-disaster Aug 16, 2023
ce4ebc2
refactor: rename Constant -> Bool
w-disaster Aug 16, 2023
9526df9
doc: add some scaladoc
w-disaster Aug 16, 2023
905b878
refactor: move extractSolutionsFromDT method
w-disaster Aug 16, 2023
c3d7c30
fix: PartialModelUtilsTest, format code
w-disaster Aug 16, 2023
868eb4b
Merge pull request #38 from Mala1180/feature/dpll-unit-propagation
w-disaster Aug 16, 2023
cd3d059
chore (green): pure literal elimination
w-disaster Aug 16, 2023
e034a1e
fix: cnf in pure lit elimination test
w-disaster Aug 17, 2023
b601ad4
Merge pull request #36 from Mala1180/feature/backlog-sprint-3
Mala1180 Aug 17, 2023
978d6be
Merge pull request #37 from Mala1180/feature/sbt-assembly
Mala1180 Aug 17, 2023
3e7f5b7
chore: PartialModel as lexicographically-ordered Seq
w-disaster Aug 17, 2023
4c664a8
small refactor
w-disaster Aug 17, 2023
cd0f621
add pure literal elimination doc
w-disaster Aug 17, 2023
e82a418
fix: fmt
w-disaster Aug 17, 2023
462c60c
ci: add workflows for releases
Mala1180 Aug 17, 2023
bdf0e99
ci: checkout code for changelog
Mala1180 Aug 17, 2023
368407f
feat: comment
Mala1180 Aug 17, 2023
094c2bf
chore: deleted changelog
Mala1180 Aug 17, 2023
198ae23
ci: skip on empty
Mala1180 Aug 17, 2023
f161028
chore: modify names
Mala1180 Aug 17, 2023
7a5bd34
docs: add changelog
Mala1180 Aug 17, 2023
03245bb
ci: add fallback version
Mala1180 Aug 17, 2023
e8b576e
chore(release): v0.1.1-test [skip ci]
invalid-email-address Aug 17, 2023
42860e4
ci: modify ci for branch test
Mala1180 Aug 17, 2023
329f39d
ci: add comment in ci
Mala1180 Aug 17, 2023
0e837ff
ci: fix branch list
Mala1180 Aug 17, 2023
beec700
ci: update ci release
Mala1180 Aug 17, 2023
fbddc0d
chore: modify jar name
Mala1180 Aug 17, 2023
3643503
fix: trim input in pre processing
Mala1180 Aug 17, 2023
bf28f21
chore: removed changelog test
Mala1180 Aug 17, 2023
311c9d6
fix: removed useless file
Mala1180 Aug 17, 2023
02e302a
feat: add basic math operators
Mala1180 Aug 17, 2023
9937306
feat: add xor operator
Mala1180 Aug 17, 2023
7eb3f0c
chore: added xor in operator list
Mala1180 Aug 17, 2023
12e6fe8
style: format
Mala1180 Aug 17, 2023
d102ea7
Merge pull request #41 from Mala1180/feature/auto-release
Mala1180 Aug 17, 2023
722b481
Merge branch 'develop' into feature/dsl-math-operators
Mala1180 Aug 17, 2023
7504ced
Merge pull request #42 from Mala1180/feature/dsl-math-operators
Mala1180 Aug 21, 2023
86ca9ea
feat: add fields to State, change xor symbol
Mala1180 Aug 21, 2023
e791d42
feat: define factories of State
Mala1180 Aug 21, 2023
a9b2b1c
add cnf-output in formal way, set textview of output cnf dialog scrol…
paga16-hash Aug 21, 2023
28f639f
format
paga16-hash Aug 21, 2023
dc64cbb
fix for architecture test
paga16-hash Aug 21, 2023
595ab58
Merge pull request #44 from Mala1180/feature/complete-model
Mala1180 Aug 21, 2023
cd74491
fix: print method
paga16-hash Aug 21, 2023
5510a52
Merge branch 'develop' into feature/cnf-output
paga16-hash Aug 21, 2023
b879475
Merge pull request #43 from Mala1180/feature/cnf-output
paga16-hash Aug 21, 2023
3ffe6b7
refactor gui, view architecture and remove useless print
paga16-hash Aug 21, 2023
d0cc834
Merge pull request #45 from Mala1180/feature/gui-refactor
paga16-hash Aug 22, 2023
fe7956d
feat: add atLeastOne and atMostOne encodings
Mala1180 Aug 22, 2023
c032a1d
feat: add print method for Expression
Mala1180 Aug 22, 2023
6a77ecb
wip: first improve to doc
paga16-hash Aug 22, 2023
08e5a24
refactor: move OrderedSeq's given, delete wrong import, rename pure l…
w-disaster Aug 23, 2023
8371593
fix: given import
w-disaster Aug 23, 2023
9d618c6
Merge pull request #39 from Mala1180/feature/dpll-pure-literals-elimi…
w-disaster Aug 23, 2023
ec8a3cd
chore: replace scoverage tool with jacoco
paga16-hash Aug 23, 2023
88ee6c1
fix: merge conflicts
w-disaster Aug 23, 2023
c5cf6fd
chore: DIMACS parse function
w-disaster Aug 23, 2023
302fd99
fix: remove smtlib
w-disaster Aug 23, 2023
7231387
ci: testing remove cache:sbt
paga16-hash Aug 24, 2023
b23447a
ci: test remove Target folder to prevent crash of workflow
paga16-hash Aug 24, 2023
5e1d332
ci: test rm target
paga16-hash Aug 24, 2023
f464d24
ci: test remove target folder
paga16-hash Aug 24, 2023
27ee416
ci: test remove target folder
paga16-hash Aug 24, 2023
2414edf
ci: test remove target folder
paga16-hash Aug 24, 2023
c73c244
ci: test remove target folder
paga16-hash Aug 24, 2023
f6fbbe8
ci: restored ci file
paga16-hash Aug 24, 2023
bc249d5
Merge pull request #46 from Mala1180/feature/cnf-dimacs-parse
w-disaster Aug 24, 2023
bc8bee5
chore: add type annotation to symbolGenerator in atMostOne
Mala1180 Aug 24, 2023
727db5b
wip: work on import from DIMACS format
paga16-hash Aug 24, 2023
f8d2b94
feat: add atMost one, atLeast one and atLEast k
Mala1180 Aug 24, 2023
859dcbe
chore: delete comment and minor change to doc
Mala1180 Aug 25, 2023
03fa314
chore: introduce lazy val
w-disaster Aug 25, 2023
3fe2c47
feat: add wrong use test for sat encoding, refactor some methods
Mala1180 Aug 25, 2023
0cfb8d2
add import from txt file containing DIMACS formula, add print method …
paga16-hash Aug 25, 2023
e5f0a02
refactor: file refactor
Mala1180 Aug 25, 2023
0fc1f5b
format
paga16-hash Aug 25, 2023
f789c01
format and removed useless imports
paga16-hash Aug 25, 2023
c05f508
chore: spaced
Mala1180 Aug 25, 2023
11ef43d
style: format
Mala1180 Aug 25, 2023
db50620
chore: integrate dpll into the View
w-disaster Aug 25, 2023
db54a2c
chore: add dpll GUI output
w-disaster Aug 25, 2023
9dac890
format DPLL
w-disaster Aug 25, 2023
924ab6c
format State
w-disaster Aug 25, 2023
af8a8b2
chore: remove print from Expression
Mala1180 Aug 25, 2023
6d7fa10
chore: change print methods name and remove some spaces in OutputTest
paga16-hash Aug 25, 2023
60c38e8
format
paga16-hash Aug 25, 2023
f6e3656
Merge pull request #48 from Mala1180/feature/import-dimacs
paga16-hash Aug 25, 2023
52a479e
Merge pull request #49 from Mala1180/feature/sat-encodings
Mala1180 Aug 25, 2023
bba99ee
fix: merge conflicts
w-disaster Aug 25, 2023
ea1d53f
Merge pull request #50 from Mala1180/feature/dpll-output
w-disaster Aug 25, 2023
eae2f9c
feat: add implies and iff operators
Mala1180 Aug 25, 2023
4d3a3d2
wip: add method for Exp -> CNF conversion if allowable
paga16-hash Aug 25, 2023
a0a9cb2
feat: add Reflection object in dsl, get operators from dsl dynamically
Mala1180 Aug 25, 2023
cbab8e4
chore: add isCNF and conversion exp -> CNF methods
paga16-hash Aug 25, 2023
c306729
docs: add some doc
Mala1180 Aug 25, 2023
1ea9977
chore: change name to operators tests
Mala1180 Aug 25, 2023
38294dc
wip: add first Feature and scenarion for Tseitin Transformation
paga16-hash Aug 25, 2023
51af7c3
Merge branch 'develop' into feature/dsl-implications
Mala1180 Aug 25, 2023
a8c49f2
style: format
Mala1180 Aug 25, 2023
04fee2b
chore: add NQueens example
w-disaster Aug 26, 2023
5d2def4
chore: DIMACS variables in lexicographically sortable, NQueens termin…
w-disaster Aug 26, 2023
d74ba99
NQueens test format
w-disaster Aug 26, 2023
94c7216
chore: add NQueens 3x3
w-disaster Aug 26, 2023
67cc30f
Merge pull request #51 from Mala1180/feature/dsl-implications
Mala1180 Aug 27, 2023
973d799
fix: transformation
paga16-hash Aug 27, 2023
42b7174
fix: tseitin tests and trasformations, removed println
paga16-hash Aug 27, 2023
31d1684
style: remove useless white spaces
paga16-hash Aug 27, 2023
baf8c5b
style: remove useless white spaces
paga16-hash Aug 27, 2023
3175dc7
Merge branch 'develop' into feature/tseitin-transformations-fix
paga16-hash Aug 27, 2023
a697898
solved conflict and style format
paga16-hash Aug 27, 2023
ba35e6f
refactor: move NQueens files
w-disaster Aug 27, 2023
73b884d
refactor: undo Example-> Problem
w-disaster Aug 28, 2023
d6e16d0
chore: add tseitin variable filter on extract solutions
w-disaster Aug 28, 2023
63b9ec8
Merge pull request #53 from Mala1180/feature/tseitin-transformations-fix
w-disaster Aug 28, 2023
24984ec
Merge branch 'develop' into feature/problems-nqueens
w-disaster Aug 28, 2023
b8e67d1
fix: dsl improvement with RegExp input processing
Mala1180 Aug 28, 2023
fa7684e
refactor: add given conversion for tuple, modify extesion methods atM…
Mala1180 Aug 28, 2023
a12e810
chore: dimacs file follows standard, edit NQueens print, add NQueens …
w-disaster Aug 28, 2023
9a16f8d
chore: integrate example into Problem
w-disaster Aug 28, 2023
9238ac9
format NQueensTest
w-disaster Aug 28, 2023
695fd56
feat: introduce reflection tests, test build with fork
Mala1180 Aug 28, 2023
4dda102
wip: test import option on ClassFileImporter
paga16-hash Aug 28, 2023
9b192c8
refactor: move dsl package outside model
Mala1180 Aug 28, 2023
0abb83a
wip: test import option for exclude instrumented-classes
paga16-hash Aug 28, 2023
3f7234d
style: remove white space
paga16-hash Aug 28, 2023
7b5a5d4
refactor: move encodings to expression package
Mala1180 Aug 28, 2023
d1c602d
Merge pull request #55 from Mala1180/feature/fix-dsl-reflection
Mala1180 Aug 28, 2023
b747244
Merge pull request #54 from Mala1180/feature/documentation-improvement
paga16-hash Aug 28, 2023
1593e2d
Merge pull request #47 from Mala1180/feature/jacoco-coverage-plugin
paga16-hash Aug 28, 2023
d51957e
fix: solve conflicts
Mala1180 Aug 28, 2023
abc9e95
chore: remove reflection tests for sbt problem
Mala1180 Aug 28, 2023
ad951f7
style: format
Mala1180 Aug 28, 2023
22386e5
refactor: modify atMostOne
Mala1180 Aug 28, 2023
8d71cda
Merge pull request #52 from Mala1180/feature/problems-nqueens
paga16-hash Aug 28, 2023
e851185
fix: fix import reflection
Mala1180 Aug 28, 2023
5cee6da
chore: remove comment
Mala1180 Aug 28, 2023
d9caf77
Merge pull request #56 from Mala1180/feature/fix-reflection-imports
Mala1180 Aug 28, 2023
8e357a8
other: prepare release, modify ci, backlog refinement
Mala1180 Aug 28, 2023
9d6ee59
docs: finished backlog
Mala1180 Aug 28, 2023
75a6177
ci: replace test branch with main
Mala1180 Aug 28, 2023
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
21 changes: 17 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Scala CI
name: Satify Build, Format and Coverage

on:
push:
branches: [ "main", "develop", "feature/**", "release/**", "hotfix/**" ]
branches: [ '**' ]
pull_request:
branches: [ "main", "develop", "release/**" ]

Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Run tests
run: sbt test

formatting:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -45,5 +45,18 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: 'sbt'
- name: Check scalafmt formatting
- name: Check scalafmt format
run: sbt scalafmtCheckAll

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'sbt'
- name: Run tests with coverage
run: sbt jacoco
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Create Release

on:
pull_request:
types:
- closed
branches:
- main

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'sbt'

- name: Create Jar Asset
run: sbt assembly

- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
title: "Sprint 3 Release"
prerelease: true
files: |
target/scala-3.3.0/satify.jar
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# [0.1.0](https://github.com/Mala1180/PPS-22-satify/compare/47a5b9fb00c7757cf5a6520fe326cc164dfefd38...v0.1.0) (2023-08-14)


### Bug Fixes

* again scalafmt ([3fd1173](https://github.com/Mala1180/PPS-22-satify/commit/3fd1173279691211cc1488ec2f02a74873b43491))
* DPLL test ([53831b1](https://github.com/Mala1180/PPS-22-satify/commit/53831b15fb769ba8d39a625f2dac9d75a5945d67))
* DPLL tests ([12884ab](https://github.com/Mala1180/PPS-22-satify/commit/12884ab36bcb1309c1cabfa00a23af2eafde0b40))
* initial implementation of Tseiting algorithm in particular substitution of variables: replace method ([bc93d18](https://github.com/Mala1180/PPS-22-satify/commit/bc93d189bec938fea862dfdf8dd785b530dcefa6))
* reformat code ([742826a](https://github.com/Mala1180/PPS-22-satify/commit/742826a4611352311be2d749b576e78bd5fea0d2))
* removed ._2 notation, chenged doc for archunit and some gramatical errors, first print of CNF formula obtained ([9b0c45a](https://github.com/Mala1180/PPS-22-satify/commit/9b0c45aad56d8e9afe44b147a4ba7627d48d278c))
* removed ambiguous symbol T from nested functions in Expression and TseitinTransformation method utils ([f97a5e2](https://github.com/Mala1180/PPS-22-satify/commit/f97a5e209ab0607002bf035b004b0ebc5d70d528))
* ReplaceTest ([668b5cd](https://github.com/Mala1180/PPS-22-satify/commit/668b5cdc1acdb0f581a09fb03ef38cb4ae66a8ba))
* simplifyClosestAnd, chore (green): exhaustive search w/CNF simplification ([430a01e](https://github.com/Mala1180/PPS-22-satify/commit/430a01e9f3f96eba89db7ef509979304c8a3c33e))
* simplifyUpperMostOr propagation through the Or root ([4ca2990](https://github.com/Mala1180/PPS-22-satify/commit/4ca299037752ad8ad196352bd84d7ca95ee93e4c))
* tests, undo CNF modifications, chore: add scaladoc in dpllcnfutils ([89df6f4](https://github.com/Mala1180/PPS-22-satify/commit/89df6f4b0a8c0c655965f43af547e3566925f181))
* transformation method and transformations tests ([d8e83ac](https://github.com/Mala1180/PPS-22-satify/commit/d8e83ac96e8476b0feb7f84839f68f2a4292e24e))
* typo in dt's search test ([44f1711](https://github.com/Mala1180/PPS-22-satify/commit/44f1711e910ace303ab1858e0703db40c379a9b9))


### Features

* add DSL with simple operators ([88b4d50](https://github.com/Mala1180/PPS-22-satify/commit/88b4d50034c011b5d9167c3269c8fac0b8190a95))
* added scalafmt.conf ([47a5b9f](https://github.com/Mala1180/PPS-22-satify/commit/47a5b9fb00c7757cf5a6520fe326cc164dfefd38))
* added scalatest and file to test it ([53efa07](https://github.com/Mala1180/PPS-22-satify/commit/53efa072e1716f40862f5e980154a578c0133e4f))
* added Solver entity and cnf converters ([664b4d6](https://github.com/Mala1180/PPS-22-satify/commit/664b4d603a7d4d71b08606bf7e0825aa9f2a8985))
* finish second backlog, print cnf output ([61bc583](https://github.com/Mala1180/PPS-22-satify/commit/61bc5833512c34d8b7ae9307ad1750bfbb54d1d9))
* setup architecture mvu with cake pattern ([ae10b4d](https://github.com/Mala1180/PPS-22-satify/commit/ae10b4d2687bf2ccacedba3c1c7c5f14251434c2))
* setup GUI, add logo ([8eb13d6](https://github.com/Mala1180/PPS-22-satify/commit/8eb13d66192b930361713d18f675cb4c3db1583e))



44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,64 @@

Satify is a pure functional SAT solver written in Scala.

It wants to be **immutable**, **declarative** and **idiomatic**
still using the OOP flexibility thanks to syntactic sugar power offered by Scala.
It wants to be **immutable**, **declarative** and **idiomatic**
still using the OOP flexibility thanks to syntactic sugar power offered by Scala 3.

Satify implements two principal algorithms:

- Tseitin transformation to convert a boolean formula in CNF (Conjunctive Normal Form).
- DPLL (Davis–Putnam–Logemann–Loveland) to solve the satisfiability problem.

Satify can simply take in input a set of clauses and say if it is satisfiable or not.
This can be done using both math-like and more verbose human-like DSLs.
This can be done using a versatile DSL providing both math-like and human-like styles.

Moreover, Satify provides a set of problems (N-Queens, Coloring Graph, Nurse Scheduling) to test the solver.
It will try also to give an instance of the problem satisfiable if it exists.

## Requirements

To correctly run Satify, you need at least these versions of the following dependencies:

- Scala 3.3.0 (currently LTS)
- SBT 1.9.1
- Java 17 (currently LTS)

## Usage
To run Satify:

### Downloading the jar

You can download the `jar` of the application in the
[release](https://github.com/Mala1180/PPS-22-satify/releases) page.

To execute it, run:

```bash
java -jar path/to/downloaded/jar
```

### Using sbt

If you have the project locally, you can use `sbt` to run the application:

```bash
sbt run
```
To run tests:

Or to run tests:

```bash
sbt test
```

## Contributions
If you want to contribute to Satify, you can fork the repository and open a pull request.
The contributions must follow some constraints:
- Attention to code style and quality.
- Don't use mutable data structures (if it's not strictly necessary).
- Introduce only tested code.
---
You can also generate a new jar (it will be located in `target/scala-3.3.0/` directory):

```bash
sbt assembly
```

## Authors

- Luca Fabri ([w-disaster](https://github.com/w-disaster))
- Mattia Matteini ([Mala1180](https://github.com/Mala1180))
- Alberto Paganelli ([paga16-hash](https://github.com/paga16-hash))
15 changes: 14 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ThisBuild / version := "0.1.0-SNAPSHOT"
val languageVersion = "3.3.0"
ThisBuild / scalaVersion := languageVersion

Test / fork := true

val scalaTest = "org.scalatest" %% "scalatest" % "3.2.16" % Test
val archUnit = "com.tngtech.archunit" % "archunit" % "1.0.0" % Test
val scalaSwing = "org.scala-lang.modules" %% "scala-swing" % "3.0.0"
Expand All @@ -13,5 +15,16 @@ val cucumber = "io.cucumber" %% "cucumber-scala" % "8.14.1" % Test
lazy val root = (project in file("."))
.settings(
name := "satify",
libraryDependencies ++= Seq(scalaTest, archUnit, slf4jSimpleLog, scalaSwing, scalaCompiler, cucumber)
libraryDependencies ++= Seq(scalaTest, archUnit, slf4jSimpleLog, scalaSwing, scalaCompiler, cucumber),
assembly / assemblyJarName := "satify.jar"
)

jacocoReportSettings := JacocoReportSettings()
.withTitle("Jacoco Satify Coverage Report")
.withThresholds(
JacocoThresholds(
branch = 40,
line = 70)
)
.withFormats(JacocoReportFormats.ScalaHTML)
jacocoExcludes := Seq("*view*", "*update.Message*", "*Main*")
6 changes: 3 additions & 3 deletions doc/process/2-product-backlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ _No remaining tasks from the previous sprint._

The goals of this sprint are:

- Termination of Tseitin transformation
- Providing a basic DSL
- Proceeding with the implementation of the DPLL algorithm
- Terminate Tseitin transformation
- Provide a basic DSL
- Proceed with the implementation of the DPLL algorithm

There will be the first release of the project permitting to take in input an expression through DSL and to apply the
Tseitin transformation (CNF conversion).
Expand Down
Loading