Skip to content

Commit

Permalink
Replaced Doxygen with DocFX
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Jan 13, 2022
1 parent 76a6fb2 commit 2ed6cee
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 29 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
/src/_ReSharper.*/
/src/*/obj/
/src/*/bin/
/doc/*.tag
/doc/obj/
/doc/api/

# Output
/artifacts/
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ pushd $PSScriptRoot

src\build.ps1 $Version
src\test.ps1
doc\build.ps1 $Version
doc\build.ps1

popd
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ cd `dirname $0`

src/build.sh ${1:-1.0-dev}
src/test.sh
#doc/build.sh ${1:-1.0-dev}
9 changes: 2 additions & 7 deletions doc/build.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
Param ($Version = "1.0-dev")
$ErrorActionPreference = "Stop"
$ErrorActionPreference = "Stop"
pushd $PSScriptRoot

if (Test-Path ..\artifacts\Documentation) {rm -Recurse -Force ..\artifacts\Documentation}
mkdir ..\artifacts\Documentation | Out-Null

$env:VERSION = $Version
..\0install.ps1 run --batch https://apps.0install.net/devel/doxygen.xml
..\0install.ps1 run --batch https://apps.0install.net/dotnet/docfx.xml --loglevel=warning --warningsAsErrors docfx.json
if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}

popd
8 changes: 0 additions & 8 deletions doc/build.sh

This file was deleted.

52 changes: 52 additions & 0 deletions doc/docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"metadata": [
{
"src": [
{
"src": "../artifacts/Release/netstandard2.1",
"files": [
"NanoByte.SatSolver*.dll"
]
}
],
"dest": "api"
}
],
"build": {
"globalMetadata": {
"_baseUrl": "https://sat-solver.nano-byte.net/",
"_appTitle": "NanoByte SAT Solver",
"_appFooter": "Copyright Bastian Eicher",
"_disableBreadcrumb": true,
"_enableNewTab": true
},
"content": [
{
"files": [
"*.md",
"toc.yml",
"api/*.yml"
]
}
],
"resource": [
{
"files": [
"*.png"
]
}
],
"overwrite": [
{
"src": "../src/",
"files": [
"**/*.md"
]
}
],
"xrefService": [
"https://xref.docs.microsoft.com/query?uid={uid}"
],
"dest": "../artifacts/Documentation"
}
}
22 changes: 13 additions & 9 deletions doc/main.md → doc/index.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
NanoByte SAT Solver is a DPLL Boolean Satisfiability Solver for .NET.
---
title: Home
---

# NanoByte SAT Solver

[**GitHub repository**](https://github.com/nano-byte/sat-solver)
NanoByte SAT Solver is a DPLL Boolean Satisfiability Solver for .NET.

## Usage

Add a reference to the [NanoByte.SatSolver](https://www.nuget.org/packages/NanoByte.SatSolver/) NuGet package to your project. It is available for .NET Framework 2.0+ and .NET Standard 1.0+.

You need to choose the underlying type to use for \ref NanoByte.SatSolver.Literal "Literals" in Boolean Formulas. This will often be `int` or `string` but you can also use any other type that implements the `IEquatable<T>` interface. You can then create an instance of \ref NanoByte.SatSolver.Solver "Solver<T>":
You need to choose the underlying type to use for [Literals](xref:NanoByte.SatSolver.Literal) in Boolean Formulas. This will often be `int` or `string` but you can also use any other type that implements the `IEquatable<T>` interface. You can then create an instance of <xref:NanoByte.SatSolver.Solver`1>:

```{.cs}
```csharp
var solver = new Solver<string>();
```

The library enables you to express Boolean \ref NanoByte.SatSolver.Formula "Formulas" using implicit casting and operators for human-friendly sample and test code:
```{.cs}
The library enables you to express Boolean [Formulas](xref:NanoByte.SatSolver.Formula`1) using implicit casting and operators for human-friendly sample and test code:
```csharp
Literal<string> a = "a", b = "b", c = "c", d = "d";
var formula = (a | b) & (!a | c) & (!c | d) & a;
```

For constructing Formulas at run-time you can use a collection-like interface instead:
```{.cs}
```csharp
var formula = new Formula<string>
{
new Clause<string> {Literal.Of("a"), Literal.Of("b")},
Expand All @@ -30,8 +34,8 @@ var formula = new Formula<string>
```

Finally, you can use the solver to determine whether a Formula is satisfiable:
```{.cs}
```csharp
bool result = solver.IsSatisfiable(formula);
```

When the Solver needs to choose a Literal to assign a truth value to during backtracking, it simply picks the first unset Literal from the list. You can replace this with your own domain-specific logic for better performance by deriving from \ref NanoByte.SatSolver.Solver "Solver<T>" and overriding the \ref NanoByte.SatSolver.Solver.ChooseLiteral "ChooseLiteral()" method.
When the Solver needs to choose a Literal to assign a truth value to during backtracking, it simply picks the first unset Literal from the list. You can replace this with your own domain-specific logic for better performance by deriving from <xref:NanoByte.SatSolver.Solver`1> and overriding the [ChooseLiteral()](xref:NanoByte.SatSolver.Solver`1#NanoByte_SatSolver_Solver_1_ChooseLiteral_NanoByte_SatSolver_Formula__0__) method.
6 changes: 6 additions & 0 deletions doc/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Home
href: index.md
- name: API
href: api/
- name: GitHub
href: https://github.com/nano-byte/sat-solver
2 changes: 0 additions & 2 deletions src/SatSolver/_Namespace.cs

This file was deleted.

5 changes: 5 additions & 0 deletions src/SatSolver/_Namespace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
uid: NanoByte.SatSolver
summary: *content
---
DPLL Boolean Satisfiability Solver.

0 comments on commit 2ed6cee

Please sign in to comment.