Fix opposite_eq method.
Simplify method in Simplify trait. Fix distributive law. Response for the simplify endpoint. HTTP client. camelCase and SCREAMING_SNAKE_CASE for struct and enum
This commit is contained in:
8
http/common.js
Normal file
8
http/common.js
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Encode the given string as a URI component, and set the request variable "expression" to the result.
|
||||
* @param {string} expression
|
||||
* @returns {void}
|
||||
*/
|
||||
export function expression(expression) {
|
||||
request.variables.set("expression", encodeURIComponent(expression))
|
||||
}
|
10
http/http-client.env.json
Normal file
10
http/http-client.env.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"dev": {
|
||||
"expression": "",
|
||||
"url": "http://localhost:8000"
|
||||
},
|
||||
"prod": {
|
||||
"expression": "",
|
||||
"url": "https://api.martials.no/simplify-truths"
|
||||
}
|
||||
}
|
29
http/simplify.http
Normal file
29
http/simplify.http
Normal file
@ -0,0 +1,29 @@
|
||||
### GET Atomic Expression
|
||||
GET {{url}}/simplify/A
|
||||
|
||||
### GET And Expression
|
||||
< {%
|
||||
import {expression} from './common.js';
|
||||
|
||||
expression("A & B")
|
||||
%}
|
||||
GET {{url}}/simplify/{{expression}}
|
||||
|
||||
### GET Or Expression
|
||||
< {%
|
||||
import {expression} from "./common";
|
||||
|
||||
expression("A | B")
|
||||
%}
|
||||
GET {{url}}/simplify/{{expression}}
|
||||
|
||||
### GET Not Expression
|
||||
GET {{url}}/simplify/!A
|
||||
|
||||
### GET Implication Expression
|
||||
< {%
|
||||
import {expression} from "./common";
|
||||
|
||||
expression("A => B")
|
||||
%}
|
||||
GET {{url}}/simplify/{{expression}}
|
Reference in New Issue
Block a user