Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mgriebling/espressoswift
Swift interface to the C-based Espresso logic minimizer.
https://github.com/mgriebling/espressoswift
Last synced: 29 days ago
JSON representation
Swift interface to the C-based Espresso logic minimizer.
- Host: GitHub
- URL: https://github.com/mgriebling/espressoswift
- Owner: mgriebling
- License: mit
- Created: 2024-11-12T15:25:59.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-12T15:27:47.000Z (about 2 months ago)
- Last Synced: 2024-11-12T16:33:51.648Z (about 2 months ago)
- Language: C
- Size: 192 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Espresso Swift
Espresso Swift provides a simple Swift interface to the **Espresso** logic
simplifier. I've provided a very basic initializer to the **Espresso** C-based
library to give Swift users the ability to use **Espresso** in their
programs. Basically, I capture the **Espresso** outputs in a file and
then return this text to the user. Inputs can come from an **Espresso**-compatible
user-supplied file or a set of name and input/output vectors. Have a look
at the [documentation](espresso5.pdf)## Features
1. Runs the Berkeley Version 2.3 of **Espresso** with some minor changes
to allow me to capture the text output.
2. Works on MacOS or iOS.## Installation
In your project's Package.swift file add a dependency like:
```
dependencies: [
.package(url: "https://github.com/mgriebling/Espresso.git", from: "0.0.1"),
]
```## Usage
Here are a few examples of to how to use this package:
```swift
let vector = [
"0000 1111 110",
"0001 0110 000",
"0010 1101 101",
"0011 1111 001",
"0100 0110 011",
"0101 1011 011",
"0110 1011 111",
"0111 1110 000",
"1000 1111 111",
"1001 1111 011",
"1010 ---- ---",
"1011 ---- ---",
"1100 ---- ---",
"1101 ---- ---",
"1110 ---- ---",
"1111 ---- ---"]input = vector.joined(separator: "\n")
let inputs = ["A", "B", "C", "D"]
let outputs = ["a", "b", "c", "d", "e", "f", "g"]
if let espresso = Espresso(inputs, outputs, vector, [.exact, .useNames]) {
results = espresso.results
}
```to produce the following output:
```
```