Skip to content

Commit

Permalink
📚 docs: Achieve 100% documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Apr 14, 2021
1 parent 9abad74 commit 5fc3c9d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/api/verify.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import _verify from '../core/_verify.js';
/**
* Verify that satisfiability of the input instance can be derived from the
* input certificate.
*
* @param {ParitiesInstance|SignsInstance|KeysInstance} instance
* @param {number[]} certificate
* @return {boolean}
*/
const verify = ({clauses}, certificate) => _verify(clauses, certificate);
export default verify;
6 changes: 3 additions & 3 deletions src/core/_verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* of clauses. The list of clauses and the assignment vector are in parity
* format.
*
* @param {Iterable} clauses The clauses in parity format.
* @param {Array} assignment The assignment vector in parity format.
* @returns {Boolean} Whether the assignment satisfies the k-CNF formula
* @param {number[][]} clauses The clauses in parity format.
* @param {number[]} assignment The assignment vector in parity format.
* @returns {boolean} Whether the assignment satisfies the k-CNF formula
* represented by the list of clauses.
*/
export default function _verify(clauses, assignment) {
Expand Down
4 changes: 4 additions & 0 deletions src/core/convert/KeysInstance.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import _certificate_to_keys from './_certificate_to_keys.js';

/**
* Maintains a mapping between variable names and a parity
* representation of the instance.
*/
export default class KeysInstance {
/**
* Constructor.
Expand Down
3 changes: 3 additions & 0 deletions src/core/convert/ParitiesInstance.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import _count from './_count.js';

/**
* Holds all properties of a k-CNF SAT instance in parity format.
*/
export default class ParitiesInstance {
/**
* Clauses are in parity format.
Expand Down
3 changes: 3 additions & 0 deletions src/core/convert/SignsInstance.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import _count from './_count.js';

/**
* Allows to produce an assignment format that makes sense in sign format.
*/
export default class SignsInstance {
/**
* Clauses are in parity format.
Expand Down

0 comments on commit 5fc3c9d

Please sign in to comment.