Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/takagiy/satysfi-karnaugh

Drawing Karnaugh maps in SATySFi / SATySFiでカルノー図を描くためのパッケージ
https://github.com/takagiy/satysfi-karnaugh

Last synced: 2 months ago
JSON representation

Drawing Karnaugh maps in SATySFi / SATySFiでカルノー図を描くためのパッケージ

Awesome Lists containing this project

README

        

# satysfi-karnaugh - Drawing Karnaugh maps in SATySFi
## example

```satysfi
let-math \dc = ${\dontcare} in
{
\karnaugh-map(${xy})(${zw}) [
${| 1 | 0 | 0 | 1 |};
${| 1 | 1 | 0 | 1 |};
${| \dc | \dc | \dc | \dc |};
${| 1 | 0 | \dc | \dc |};
] [
Karnaugh.box (0, 1);
Karnaugh.tall (3, 0);
];
}

{
\karnaugh-map(${AB})(${C}) [
${| 1 | 1 | 0 | 1 |};
${| 1 | 0 | 0 | 0 |};
] [
Karnaugh.slim (0, 0);
Karnaugh.flat (0, 0);
Karnaugh.flat (3, 0);
];
}
```

The adbove will look like the following.

![output](/docs/example.png)

## reference
* `\dontcare` : `[] math-cmd`

* “∅” in formula

* `\karnaugh-map` : `[math; math; (math list) list; (length list -> length list -> graphics list) list] inline-cmd`
`\karnaugh-map` : ` `
* Draw a Karnaugh map

* `Karnaugh.box` : `int * int -> lenght list -> length list -> graphics list`
`Karnaugh.box` : `(, ) -> `
* Group 2x2 cells

* `Karnaugh.tall` : `int * int -> lenght list -> length list -> graphics list`
`Karnaugh.tall` : `(, ) -> `
* Group 2x4 cells

* `Karnaugh.wide` : `int * int -> lenght list -> length list -> graphics list`
`Karnaugh.wide` : `(, ) -> `
* Group 4x2 cells

* `Karnaugh.slim` : `int * int -> lenght list -> length list -> graphics list`
`Karnaugh.slim` : `(, ) -> `
* Group 1x2 cells

* `Karnaugh.flat` : `int * int -> lenght list -> length list -> graphics list`
`Karnaugh.flat` : `(, ) -> `
* Group 2x1 cells

* `Karnaugh.minimum` : `int * int -> lenght list -> length list -> graphics list`
`Karnaugh.minimum` : `(, ) -> `
* Group 1x1 cells

* `Karnaugh.large` : `int * int -> lenght list -> length list -> graphics list`
`Karnaugh.large` : `(, ) -> `
* Group 4x4 cells

* `Karnaugh.group` : `int -> int -> int * int -> lenght list -> length list -> graphics list`
`Karnaugh.group` : ` (, ) -> `
* Group `width`x`height` cells

* `Karnaugh.group-` : `int * int -> int * int -> lenght list -> length list -> graphics list`
`Karnaugh.group-` : `(, ) (, ) -> `
* Group the cells in the specific range