承接 noorani-mm/math-implies 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

noorani-mm/math-implies

最新稳定版本:v1.0.1

Composer 安装命令:

composer require noorani-mm/math-implies

包简介

This package facilitates the solution of discrete mathematical problems.

README 文档

README

This package facilitates the solution of discrete mathematical problems.

How to install

composer require noorani-mm/math-implies

How to use

Provide your desired logical statement as the parameter to the Implies class.

$implies = new \Math\Implies\Implies('p->q');

From now on, you can retrieve the required outputs.

Table

It constructs a truth table by placing the column headers in the first row and sequentially adding rows to represent logical conditions.

$result = $implies->table
/**
[
  ["p",     "q",  "(p -> q)"], This is columns and others are value
  ["0",     "0",     "1"    ],
  ["0",     "1",     "1"    ],
  ["1",     "0",     "0"    ],
  ["1",     "1",     "1"    ],
]
 */

Columns

It displays the computed logical expressions.

$test1 = $implies->columns(); // ['p', 'q', '(p -> q)']
$test2 = $implies->columns;   // ['p', 'q', '(p -> q)']

Rows

It returns the result of the truth table computation.

$test1 = $implies->rows(); // ["001", "011", "100", "111"]
$test2 = $implies->rows;   // ["001", "011", "100", "111"]

PDNF

The pdnf function returns a string representing the sum of products of the logical statement, obtained by multiplying the components of the logical expression.

Meanwhile, the pdnf property returns an array representing individual product terms of the logical expression, where each element corresponds to a specific term obtained by multiplying the components of the logical statement.

$string = $implies->pdnf(); // "(~p^~q)v(~p^q)v(p^q)"
$array  = $implies->pdnf;   // ["(~p^~q)", "(~p^q)", "(p^q)"]

PCNF

The pcnf function returns a string representing the Product of Sums Normalized (PCNF) for a logical statement by adding its components.

Meanwhile, the pcnf property returns an array representing individual sum terms of the logical expression, with each element corresponding to a specific term obtained by adding the components of the logical statement.

$string = $implies->pcnf(); // "(pv~q)"
$array  = $implies->pcnf;   // ["(pv~q)"]

minterm

The minterm function computes minterms for a logical statement, providing a summarized string representation. The minterm property returns an array of individual minterms, enhancing clarity on the logical conditions.

$string = $implies->minterm(); // "Σ(0,1,3)"
$array  = $implies->minterm;   // [0,1,3];

maxterm

The maxterm function calculates maxterms for a logical statement, presenting a concise string representation. The maxterm property returns an array of individual maxterms, contributing to a clear understanding of the logical conditions.

$string = $implies->maxterm(); // "π(2)"
$array  = $implies->maxterm;   // [2]

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固