Skip to content

Commit

Permalink
Fixed typo from PR #598 and documentation bits for set operators (#599)
Browse files Browse the repository at this point in the history
* write start of L_Plus.md

* Plus and Minus docs and its notebook

* wrote doc pages for all the operators.

* fix to meet agreed format

* Created using Colaboratory

* add multiplicationDemonstration.ipynb

* add absoluteValues.ipynb

* add factorial.ipynb

* add toInt_demonstration.ipynb

* fixed absoluteValues.ipynb

* added notebook links

* fixed L_Minus.md typo

* improved these notebooks with hz66-404 suggestions

* fixed typo

* add Set_operators demonstration

* Create L_union.md

* Update Set_operators.ipynb add badge and title

* Create L_intersect.md

* fixed badge Set_operators.ipynb

* Create L_subset.md

* Update Set_operators.ipynb

Changed "subset" italics issue

* Rename addition_subtraction_examples.ipynb to addition_and_subtraction_examples.ipynb

fixed typo from recent PR

* Update Set_operators.ipynb

fix the grammar

* Create L_subsetEq.md

* Update L_subsetEq.md

* Create L_supset.md

* Create L_supsetEq.md

* Update L_supset.md

* Update Set_operators.ipynb

update the last subset to subsetEq / some grammar changed

* Update Set_operators.ipynb

* add L_in.md

* Delete docs/notebooks/Set_operators.ipynb

this file lack of "in" this keyword

* new Set_operators demonstration

* Update Set_operators.ipynb add badge and title

* Update L_in.md changed links

* Update L_intersect.md changed links

* Update L_subset.md changed links

* Update L_subsetEq.md changed links

* Update L_supset.md changed links

* Update L_supsetEq.md changed links

* Update L_union.md changed links

---------

Co-authored-by: Han Zheng <117105566+hz66-404@users.noreply.github.com>
  • Loading branch information
N-J-Martin and hz66-404 committed Nov 4, 2023
1 parent 37112e0 commit 5061e57
Show file tree
Hide file tree
Showing 9 changed files with 1,066 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/bits/operator/L_in.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# in (membership check)
# in

test if element is in set

```essence
in
find a : bool such that a = (1 in {0,1})
```
The in operator is checks if the left operand is contained within the right operand.
This syntax is checking if 1 is in the set {0,1}

See it demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/Set_operators.ipynb).
10 changes: 10 additions & 0 deletions docs/bits/operator/L_intersect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# intersect

Set of elements in both sets

```essence
find A : set of int(0..6) such that A = {1,2,3} intersect {2,3}
```
This syntax is finding the intersection part of {1,2,3} and {2,3}

See it demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/Set_operators.ipynb).
10 changes: 10 additions & 0 deletions docs/bits/operator/L_subset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# subset

test if first set is strictly contained in second set (exclude two sets are equal)

```essence
find b : bool such that b = ({0,1} subset {0,1,3})
```
This syntax is testing if {0,1,3} contains {0,1}

See it demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/Set_operators.ipynb).
10 changes: 10 additions & 0 deletions docs/bits/operator/L_subsetEq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# subsetEq

test if first set is strictly contained in second set (two sets can be equal)

```essence
find b : bool such that b = ({0,1} subsetEq {0,1})
```
This syntax is testing if {0,1} contains {0,1}

See it demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/Set_operators.ipynb).
10 changes: 10 additions & 0 deletions docs/bits/operator/L_supset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# supset

test if the first set strictly contains the second set (exclude two sets are equal)

```essence
find b : bool such that b = ({2,1} supset {1})
```
This syntax is testing if {2,1} contains {1}

See it demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/Set_operators.ipynb).
10 changes: 10 additions & 0 deletions docs/bits/operator/L_supsetEq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# supsetEq

test if the first set contains the second set (two sets can be equal)

```essence
find b : bool such that b = ({2} supsetEq {2})
```
This syntax is testing if {2} contains {2}

See it demonstrated [here](https://github.com/conjure-cp/conjure/blob/main/docs/notebooks/Set_operators.ipynb).
10 changes: 10 additions & 0 deletions docs/bits/operator/L_union.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# union

Set of elements in either of the sets

```essence
find B : set of int(0..6) such that B = {1,2,3} union {3,4}
```
This syntax is finding the union of two sets {1,2,3} and {3,4}

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

0 comments on commit 5061e57

Please sign in to comment.