Skip to content

Commit

Permalink
Relation domains (#627)
Browse files Browse the repository at this point in the history
* relation draft

* adjusted size attribute pages to include relation

* add reflexive attributes

* add symmetric type attributes

* adding other attributes

* add notebook
  • Loading branch information
N-J-Martin committed Nov 23, 2023
1 parent 96cf1fa commit dcec728
Show file tree
Hide file tree
Showing 19 changed files with 1,557 additions and 5 deletions.
7 changes: 7 additions & 0 deletions docs/bits/attribute/L_Euclidean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Euclidean

A relation is Euclidean if ```a``` is related to ```b``` and ```c```, then ```b``` is related to ```c```.

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Euclidean_relation).

6 changes: 6 additions & 0 deletions docs/bits/attribute/L_aSymmetric.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# aSymmetric

An asymmetric relation is a relation where if ```a``` is related to ```b```, then ```b``` is not related to ```a```.

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Asymmetric_relation).
8 changes: 8 additions & 0 deletions docs/bits/attribute/L_antiSymmetric.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# antiSymmetric

A relation is anti symmetric that for every ```a``` related to ```b```, where ```a != b```, ```b``` is not related to ```a```.

Essentially, if ```a``` is related to ```b``` and ```b``` is related to ```a```, then ```a = b```.

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Antisymmetric_relation).
6 changes: 6 additions & 0 deletions docs/bits/attribute/L_connex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# connex

A connected relation is a relation where all elements in either domain are related (in one direction or the other).

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Connected_relation).
7 changes: 7 additions & 0 deletions docs/bits/attribute/L_coreflexive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# coreflexive

When used with relation domains, ensures that if ```x``` is related to ```y```, then ```x = y```.
This means elements of domains are only mapped to themselves.

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Reflexive_relation).
6 changes: 6 additions & 0 deletions docs/bits/attribute/L_equivalence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# equivalence

An equivalence relation is a relation that is [reflexive](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_reflexive.md), [symmetric](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_symmetric.md), and [transitive](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_transitive.md).

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Equivalence_relation).
6 changes: 6 additions & 0 deletions docs/bits/attribute/L_irreflexive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# irreflexive

When used with relation domains, produces solutions where elements of one domain are not related to themselves.

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Reflexive_relation).
4 changes: 3 additions & 1 deletion docs/bits/attribute/L_maxSize.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
Takes an integer parameter, n.

When used with a function domain will limit the solutions to functions that contains at most n mappings.
When used with a relation domain will produce solutions that have up to n tuples.

See it demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/functionDemonstration.ipynb).
See it demonstrated on function domains [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/functionDemonstration.ipynb).
See it demonstrated on relation domains [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb)
4 changes: 3 additions & 1 deletion docs/bits/attribute/L_minSize.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
Takes an integer parameter, n.

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

See it demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/functionDemonstration.ipynb).
See it demonstrated on function domains [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/functionDemonstration.ipynb).
See it demonstrated on relation domains [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb)
6 changes: 6 additions & 0 deletions docs/bits/attribute/L_partialOrder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# partialOrder

A relation that has a partial order is a relation that is [reflexive](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_reflexive.md), [antiSymmetric](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_antiSymmetric.md), and [transitive](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_transitive.md).

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Partially_ordered_set).
6 changes: 6 additions & 0 deletions docs/bits/attribute/L_reflexive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# reflexive

When used with relation domains produces solutions where every element in one domain is related to itself.

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Reflexive_relation).
6 changes: 6 additions & 0 deletions docs/bits/attribute/L_serial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# serial

A serial relation expresses the relationship between an element of a sequence and it's successor.

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Serial_relation).
4 changes: 3 additions & 1 deletion docs/bits/attribute/L_size.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
Takes an integer parameter, n.

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

See it demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/functionDemonstration.ipynb).
See it demonstrated on function domains [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/functionDemonstration.ipynb).
See it demonstrated on relation domains [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb)
6 changes: 6 additions & 0 deletions docs/bits/attribute/L_symmetric.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# symmetric

A relation is symmetric if when ```a``` is related to ```b```,```b``` is also related to ```a```.

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Symmetric_relation).
4 changes: 3 additions & 1 deletion docs/bits/attribute/L_total.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# total

When used with a function domain will only return solutions that have mappings for every element in the defined set.
When used with a relation domain, ensure that each element of the first domain is related to an element of the second domain.

See it demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/functionDemonstration.ipynb).
See it demonstrated on function domains [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/functionDemonstration.ipynb).
See it demonstrated on relation domains [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
6 changes: 6 additions & 0 deletions docs/bits/attribute/L_transitive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# transitive

A relation is transitive if ```a``` is related to ```b```, and ```b``` is related to ```c```, then ```a``` is also related to ```c```.

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).
Read more about this property [here](https://en.wikipedia.org/wiki/Transitive_relation).
2 changes: 1 addition & 1 deletion docs/bits/keyword/letting_domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Types of domains:
- [multi-set](...)
- [function](https://github.com/conjure-cp/conjure/blob/main/docs/bits/type/function.md)
- [sequence](...)
- [relation](...)
- [relation](https://github.com/conjure-cp/conjure/blob/main/docs/bits/type/L_relation.md)
- [partition](...)


Expand Down
35 changes: 35 additions & 0 deletions docs/bits/type/L_relation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# relation

A list of pairs of elements of given domains that are related to each other.

Defined by
```
relation (optional attributes) of (domain1 * domain2 * ...)
```

They can be explicitly defined using tuples (of the same type) as
```
letting R be relation((1,1,0),(1,0,1),(0,1,1))
```

Relations have two groups of attributes
1. cardinality related
- [size](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_size.md)
- [minSize](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_maxSize.md)
- [maxSize](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_minSize.md)
2. Binary Relation (only on relations that contain 2 identical domains)
- [reflexive](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_reflexive.md)
- [irreflexive](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_irreflexive.md)
- [coreflexive](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_coreflexive.md)
- [symmetric](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_symmetric.md)
- [antiSymmetric](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_antiSymmetric.md)
- [aSymmetric](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_aSymmetric.md)
- [transitive](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_transitive.md)
- [total](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_total.md)
- [connex](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_connex.md)
- [Euclidean](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_Euclidean.md)
- [serial](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_serial.md)
- [equivalence](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_equivalence.md)
- [partialOrder](https://github.com/conjure-cp/conjure/blob/main/docs/bits/attribute/L_partialOrder.md)

See this demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/RelationDomains.ipynb).

0 comments on commit dcec728

Please sign in to comment.