Publish:2023-09-06 00:48:06, Update:2023-09-06 00:48:06
« Previous
Next »
LogicScript
The LogicScript is a simple command-line script language designed for simply accessing the core libraries of the computational boolean algebra.
What is LogicScript?
The logic-script provides the textbook-oriented expression of the
logic-objects.
For example, a logic-object could be expressed in the following forms:
[logicfunction]=AndOr()
{
-1,-2;
1,-2;
}
The LogicScript also provides the keywords covered by all the textbooks of boolean algebra, including the following area:
-
The number systems, including the binary system.
-
The expression and manipulation of the combinatorial logic objects.
-
Simplification of the combinatorial logic-functions
-
Realization of the combinatorial logic functions
-
The expression and manipulation of the sequential logic systems.
-
The realization of the sequential logic systems.
-
The simulation of the logic systems.
-
The Shannon Expansion and the BDD.
-
The SAT solver.
-
The advanced boolean algebra, including the matching of logic functions.
Language Specification
The LogicScript contains three basic objects:
-
The basic literals and objects.
-
The logic objects.
-
The command lines.
Literals and Basic Objects
The LogicScript supports the following literals:
-
int a = 1;
Integer Number
-
real a = 3.14159;
Read Number
-
string str = "...";
String (Backslash-ed character list. ig newline "\n")
-
string str = @"...";
@String
(Non-backslash-ed character list)
-
var a = 1;
Symbol, indicating the logic variables, state variables or any index-type symbol.
-
list a = list(1,2,3);
List, an ordered container for similar type of basic objects.
-
object a = object(1, "test", AndOr(){1,-2;});
Object, an ordered container for different type of basic objects or logic objects.
However, the LogicScript does not support the arithmetic or algebraic manipulation of these basic data.
This is because the computational Boolean algbera is an symbolic application.
On the other hand, the LogicScript supports the list definition of the objects. A list of object is commonly defined as
-
a = int(1,2,3);
-
a = real(3.14159,1.41425,1);
-
str = string("a","b","c");
-
a = var(1,2,3);
All this list is processed as the 'list' and the data are casted to the specified type.
Logic Objects
The logic object includes all kind of logic functions, any descriptor of the combinatorial logic model and any descriptor of the sequential logic model.
Each logic object will be discussed in the other topics.
Command Line
The command line has an unique definition
[output-arg-list]=command(input-arg-list) ;
-
output-arg-list
The list of objects that are generated by the command.
-
input-arg-list
The list of objects that are necessary by the operation of the command.
The command remains the style of the static method invocation from the object-oriented programming, where it may contain some namespace,
ig List.Get, Convert.ToAndOr.
Rules for the returned values of the
output-arg-list:
-
[x] for [a,b,c]=command()
\( \longrightarrow \) x=list(a,b,c)
-
[x,y,z] for [a,b,c]=command()
\( \longrightarrow \) x=a, y=b, z=c
-
[x,y] for [a,b,c]=command()
\( \longrightarrow \) x=a, y=b, c
is ignored
-
[x,y,z,t] for [a,b,c]=command()
\( \longrightarrow \) x=a, y=b, z=c, t
is not been processed
Computation Result
Our current version LogicScript is processed over the network, and the computation is time-comsuming.
Therefore, it is practical to display or save the result of each single computation.
In LogicScript, we can print the result on the screen.
Print( comma_separated_literals_or_objects );
Print( 1, "a", AndOr(){1,2;}, true );
Print( "The result is:", Analysis.IsOneFunction(AndOr(){ -1; }) );
« Previous
Next »