Proviant 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Proviant --version 1.0.3                
NuGet\Install-Package Proviant -Version 1.0.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Proviant" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Proviant --version 1.0.3                
#r "nuget: Proviant, 1.0.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Proviant as a Cake Addin
#addin nuget:?package=Proviant&version=1.0.3

// Install Proviant as a Cake Tool
#tool nuget:?package=Proviant&version=1.0.3                

Proviant Build Status Nuget

Proviant is a framework which evaluate boolean-expressions with the help of the Shunting-yard algorithm.

Features

  • Calculating boolean-algebra expression
  • Generating a truth table for a boolean expression
  • Create your own expression evaluator for a specific gramma.

Supported opertaors

Operatorname Symbol Precedence Is unary
NOT 5 true
AND 4 false
NAND 4 false
OR 3 false
NOR 3 false
Material Implecation 2 false
Material Eqvivalence 1 false

Usage

Boolean Algebra

Evaluate a common boolean expression

Add using:

using Proviant;

Till now the tokens in an expression string need to be seperated by a whitespace. Create a new expression:

// A boolean expression.
string expressionString = "false or true and ( false ⇔ false )";
// Create a new BooleanAlgebraExpression instance.
var expr = new BooleanAlgebraExpression(expressionString);

// Evaluate expression.
// Result will be true.
bool result = expr.Evaluate();
Generating a truth-table
// A boolean expression.
string expressionString = "A or B and C";
// Create a new BooleanAlgebraExpression instance.
var expr = new BooleanAlgebraExpression(expressionString);

// returns TruthTable class.
var truthTable = expr.GenerateTruthTable();

The truth-table would look like:

A B C Y
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1

1 = True
0 = False
Y = represents the evaluated result

TruthTable class documentation
Property Type Description
TruthRows TruthRows A truth row contains the state of each variable and the calculated result.
Rows int The total count of rows in this truth-table.
Colums int The total count of colums in this truth-table.
TruthRow class documentation
Property Type Description
Operands Dictionary<string, bool> A dictionary of operand and it's current state. The key is the operand. The value represents the state of the operand.
EvaluatedResult bool The evaluated result.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.4 11,975 3/28/2019
1.1.3 607 3/27/2019
1.1.2 560 3/25/2019
1.1.1 577 3/25/2019
1.1.0 565 3/25/2019
1.0.8 575 3/22/2019
1.0.7 560 3/21/2019
1.0.6 573 3/21/2019
1.0.5 593 3/19/2019
1.0.4 587 3/18/2019
1.0.3 561 3/18/2019
1.0.2 640 3/15/2019
1.0.1 610 3/15/2019
1.0.0 621 3/13/2019

- Exclude unused dlls from nuget file, this caused problems in some cases.