Skip to content

Commit

Permalink
Merge pull request #593 from N-J-Martin/main
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurakgun committed Oct 25, 2023
2 parents e1e1625 + 930f49a commit 9c3c17c
Show file tree
Hide file tree
Showing 10 changed files with 1,017 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/bits/attribute/L_bijective.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# bijective

When used with a function domain will restrict solutions to functions that are both [injective](https://github/conjure-cp/conjure/docs/bits/attribute/L_injective.md) and [surjective](https://github/conjure-cp/conjure/docs/bits/attribute/L_surjective.md).

This means that every element of the defined set has a unique mapping to a range element and every range element has a defined element that maps to it.

See it demonstrated [here](https://github/conjure-cp/conjure/docs/notebooks/functionDemonstration.ipynb).
5 changes: 5 additions & 0 deletions docs/bits/attribute/L_injective.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# injective

When used with a function domain will restrict solutions to functions where elements of the defined map uniquely to elements of the range.

See it demonstrated [here](https://github/conjure-cp/conjure/docs/notebooks/functionDemonstration.ipynb).
7 changes: 7 additions & 0 deletions docs/bits/attribute/L_maxSize.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# maxSize

Takes an integer parameter, n.

When used with a function domain will limit the solutions to functions that contains at most n mappings.

See it demonstrated [here](https://github/conjure-cp/conjure/docs/notebooks/functionDemonstration.ipynb).
7 changes: 7 additions & 0 deletions docs/bits/attribute/L_minSize.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# minSize

Takes an integer parameter, n.

When used with a function domain will limit the solutions to functions that contains at least n mappings.

See it demonstrated [here](https://github/conjure-cp/conjure/docs/notebooks/functionDemonstration.ipynb).
7 changes: 7 additions & 0 deletions docs/bits/attribute/L_size.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# size

Takes an integer parameter, n.

When used with a function domain will limit the solutions to functions that contain n mappings.

See it demonstrated [here](https://github/conjure-cp/conjure/docs/notebooks/functionDemonstration.ipynb).
5 changes: 5 additions & 0 deletions docs/bits/attribute/L_surjective.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# surjective

When used with a function domain will restrict solutions to functions where there is a mapping to every element in the range.

See it demonstrated [here](https://github/conjure-cp/conjure/docs/notebooks/functionDemonstration.ipynb).
5 changes: 5 additions & 0 deletions docs/bits/attribute/L_total.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# total

When used with a function domain will only return solutions that have mappings for every element in the defined set.

See it demonstrated [here](https://github/conjure-cp/conjure/docs/notebooks/functionDemonstration.ipynb).
29 changes: 29 additions & 0 deletions docs/bits/type/function.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# function

Takes 2 [domains](https://conjure.readthedocs.io/en/latest/essence.html#domains) as arguments: the ```defined``` set and the ```range``` set of the function.
The ```defined``` set is the domain of the function - the set of inputs for the function
the ```range``` set is the codomain of the function - the set of possible outputs for the function

```essence
**function** < comma separated attributes(optional)> <defined> --> <range>
```

There are 3 groups of function attributes:

- related to cardinality = [size](https://github/conjure-cp/conjure/docs/bits/attribute/L_size.md), [minSize](https://github/conjure-cp/conjure/docs/bits/attribute/L_minSize.md), and [maxSize](https://github/conjure-cp/conjure/docs/bits/attribute/L_maxSize.md). They take arguments.

- related to function properties = [injective](https://github/conjure-cp/conjure/docs/bits/attribute/L_injective.md), [surjective](https://github/conjure-cp/conjure/docs/bits/attribute/L_surjective.md), [bijective](https://github/conjure-cp/conjure/docs/bits/attribute/L_size.md).

- related to partiality = [total](https://github/conjure-cp/conjure/docs/bits/attribute/L_total.md).

Functions are partial by default

You can also explicity define a function as seen [here](https://github/conjure-cp/conjure/docs/notebooks/functionDemonstration.ipynb).

See demonstrations of the function attributes [here](https://github/conjure-cp/conjure/docs/notebooks/functionDemonstration.ipynb).

Or see functions used to solve the Magic Hexagon Problem [here](https://github.com/conjure-cp/conjure/tree/main/docs/notebooks/magicHexagon.ipynb).

Much of the information about functions lifted from [the readthedocs](https://conjure.readthedocs.io/en/latest/essence.html).


503 changes: 503 additions & 0 deletions docs/notebooks/functionDemonstration.ipynb

Large diffs are not rendered by default.

0 comments on commit 9c3c17c

Please sign in to comment.