****************************************************
*
*	### InCLosure Help File ###
*
****************************************************
*
*	InCLosure (Interval enCLosure)
*	A Language and Environment for Reliable Scientific Computing
*	InCLosure version 4.0
*
*	Support Link: http://scholar.cu.edu.eg/henddawood/software/InCLosure
*	Community Link: https://zenodo.org/communities/inclosure/
*	Releases and Updates: https://doi.org/10.5281/zenodo.2702404
*
*	Copyright (c) 2018-2023 by Hend Dawood.
*	All rights reserved.
*
****************************************************

================================
Installing and Running InCLosure
================================

Prerequisites for Installing InCLosure:
	
	-An appropriate version of Microsoft Windows. InCLosure runs on Windows 7 32/64 bit, Windows 8 32/64 bit, Windows 10 32/64 bit, and Windows 11.
	-About 10 MB of disk space.

Installing InCLosure:

	-Once the requirements are met, you can start the InCLosure installation using the installer provided.
	-Upon starting the installation, you will be presented with the InCLosure License Agreement. You should accept the terms mentioned in the agreement to proceed with the installation of InCLosure.
	-Upon completion of the installer, press "Finish" to exit the installer.
	-If the installation process is completed successfully, the InCLosure start menu and desktop shortcuts will be created.

Running InCLosure and Getting Help:

	-You should have an InCLosure icon on your desktop. Also you should have an entry for InCLosure in your Start Menu. Double-Click on the desktop icon (or alternatively, click the Start Menu entry) to start the InCLosure interface.
	-Upon launching the InCLosure window, you will be presented with the message:	
		Save current session? (y/n)
	 Type y or n and press Enter.
	-Now, an InCLosure command prompt will be available to execute InCLosure commands interactively.
		[InCL]:-
	-For license information, execute "L" at the InCLosure prompt.
	-For getting help (this file), execute "help".
	-Go through the examples in this help file and execute some commands to get familiar with InCLosure.
	-Finally, type "exit" to close InCLosure.


===================
Naming of Variables
===================
The name of a variable can include letters, digits, or underscores, and must start with a letter.

	E.g. x, y, x1, X_1, xx (Correct)
		1x, _y, x 1, y-1 (Incorrect)


========
Comments
========
Comments are human-readable notes which are completely discarded by InCLosure.
Only single-line comments are allowed. A single-line comment starts with a semicolon (;).
The following line demonstrates an InCLosure comment:

	; A nice InCLosure command returns an interesting result

	
====================================
Simple Real and Interval Evaluations
====================================
InCLosure allows direct evaluation of real and interval expressions.

	E.g.:
		[InCL]:- sin(3)+2
			2.1411200080598672221
		[InCL]:- [1,2]+sin([3,4])
			[ 0.24319750469207174862 , 2.14112000805986722211 ]


======================================
Checking Order of Two Interval Numbers
======================================
InCLosure allows direct check of order of two interval numbers.

	E.g.:
		[InCL]:- [2.717,2.727] >= [2.71,2.72]
			true

========================
InCLosure General Syntax
========================
An InCL command is of the form (keyword arguments)
	
    Keyword   arg1  <arg2>  arg3  <arg4>
	
Where:
	
	-"Keyword" is an InCL keyword. InCL Keywords are case-insensitive.
	-"arg1", "arg2", etc. are arguments. The type of an argument (integer, real, string, etc) will be stated for each command.
    -Arguments between angle brackets are optional. For example <arg2> and <arg4> are optional arguments.
	-Arguments are separated by a space.


=========================================
Evaluation of Multivariate Real Functions
=========================================

	rEval var-ex var-values <pr>

;; Basic Real Evaluation Function ;;
;; Evaluates multivariate real expressions ;;
;; Enter lowercase variable symbols for real evaluation ;;
;; Enter logarithms as logbase(number) e.g. log10(x), log2(e) ;;

;; Arguments:
	;	var-ex (string): a real expression in one or more variables,
	;	var-values (string): a list of string parameters of the form "var=value" e.g. "x=a", "y=b", where x, y are real variable names in lowercase and a, b are the points or constant real expressions to evaluate x, y at,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

rEval "2*x+y" "x=1" "y=2" 30 (where the last number is the precision of the result)
rEval "2*x+3" "x=1" (precision is defaulted to 20)
rEval "sin(x^2)+cos(x^2)+x^tan(x)^3+x*e^sin(x^3)+sin(x*x)^-3" "x=0.5+0.5" (precision is defaulted to 20)
-----------------------------------------

	rEval const-ex <pr>

;; Evaluates constant real expressions ;;

;; Arguments:
	;	const-ex (string): a constant real expression,   
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Example:

rEval "2*3+sin(4)" 30 (where the last number is the precision of the result)


==============================
Real Automatic Differentiation
==============================

	AD ex var-value <pr>

;; Basic Real AD Function ;;

;; Arguments:	
	;	ex (string): a real function expression,
	;	var-value (string): a string parameter of the form "var=value", where "var" is a real variable name in lowercase, and "value" could be a real number or a constant real expression,
	;	pr (integer): the precision (optional and default is 20) ;;

Examples:

AD "2*x^3" "x=-2" 30 (where the last number is the precision)
AD "sin(x^3)" "x=2" (precision is defaulted to 20)
AD "sin(e^(x*(sin(cos(tan(sec(csc(e^(0.5^x+e^-x^2/8*7)))))))))" "x=0.5+1.5" (precision is defaulted to 20)


==============================================================
Evaluation of Multivariate Interval Functions with Subdivision
==============================================================

	iEval var-ex <n> var-values <pr>

;; Basic Interval Evaluation Function ;;
;; Evaluates multivariate interval expressions with or without subdivision ;;
;; Enter uppercase variable symbols for interval evaluation ;;
;; Enter logarithms as logbase(interval) e.g. log10(X) ;;

;; Arguments:
	;	var-ex (string): an interval expression in one or more variables,
	;	n (integer): number of subintervals for each variable (optional and default is 1),
	;	var-values (string): a list of string parameters of the form "var=value" e.g. "X=A", "Y=B", where X, Y are interval variable names in uppercase and A, B, are the intervals or constant interval expressions to evaluate X, Y at,
	;	pr (integer): the precision of the result (optional and default is 20)	;;

Examples:

iEval "X*Y/Z-X*Y-Z" 5 "X=[-1,1]" "Y=[-2,2]" "Z=[1,2]" 10 (where 5 subdivisions applied and 10 is the precision)
iEval "cos(X*Y)" "X=[-1,1]" "Y=[0,2]" (no subdivision and precision is defaulted to 20)
iEval "[1,2]*X^20+e^X-X^15-log10(X+2)" 5 "X=[0.5,1]+[0.5,1]" (where 5 subdivisions applied and precision is defaulted to 20)
-----------------------------------------

	iEval const-ex <pr>

;; Evaluates constant interval expressions ;;

;; Arguments:	
	;	const-ex (string): a constant interval expression,   
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Example:

iEval "[1,2]+sin([3,4])" 30 (precision is 30)


==================================
Interval Automatic Differentiation
==================================

	IAD ex <n> var-value <pr>

;; Interval AD with or without Subdivision technique ;;

;; Arguments:	
	;	ex (string): an interval function expression,
	;	n (integer): number of subintervals (optional and default is 1),
	;	var-value (string): a string parameter of the form "var=value", where "var" is an interval variable name in uppercase, and "value" could be an interval number or a constant interval expression,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
			
Examples:

IAD "X^3" 10 "X=[-1,1]" 30 (where 10 subdivisions applied and 30 is the precision)
IAD "sin(X^3)" 10 "X=[-1,1]" (where 10 subdivisions applied and precision is defaulted to 20)
IAD "[-0.5,-0.4]*X^10-[-3,-2]*X^6-sin(e^(5/8*(sin(cos(e^(3^X+e^-X/5/3*4))))))-[0,2]" 20 "X=[-1,0]+[0,2]" (where 20 subdivisions applied and precision is defaulted to 20)


=========================
Ordering Interval Numbers
=========================

	checkOrder ex <pr>
	
;; Checks order of two interval or real expressions ;;
;; Returns true or false ;;
;; Order Relations are: ==, <=, >=, <, > ;;

;; Arguments:
	;	ex (string): a relational expression to check if true or false,
	;	pr (integer): the precision of the operands (optional and default is 20) ;;
	
Examples:

checkOrder "[2.717,2.727] >= [2.71,2.72]" (precision is defaulted to 20)
checkOrder "[1.525,2.5] + 3.5 < [4.55,4.567]" 2 (precision is 2)


==========================
Real Polynomial Arithmetic
==========================

;; ADDITION ;;

	PAdd polys var <pr>

;; Returns the addition of any number of real polynomials ;;

;; Arguments:
	; 	polys (string): a list of real polynomials each represented as a string,
	; 	var (string): the real variable of the polynomials as a string,
	; 	pr (integer): the precision of the coefficients (optional and default is 20) ;;
		   
Examples:

PAdd "x" "2*x" "1+x^2" "x"
PAdd "x" "2*x" "1+x^2" "x" 30
-----------------------------------------

;; SUBTRACTION ;;

	PSubt polys var <pr>

;; Returns the subtraction of any number of real polynomials ;;

;; Arguments:
	;	polys (string): a list of real polynomials each represented as a string,
	;	var (string): the real variable of the polynomials as a string,
	;	pr (integer): the precision of the coefficients (optional and default is 20) ;;
	
Examples:

PSubt "x" "2*x" "1" "x"
PSubt "x" "2*x" "1" "x" 30
-----------------------------------------

;; MULTIPLICATION ;;

	PMult polys var <pr>

;; Returns the multiplication of any number of real polynomials ;;

;; Arguments:
	;	polys (string): a list of real polynomials each represented as a string,
	;	var (string): the real variable of the polynomials as a string,
	;	pr (integer): the precision of the coefficients (optional and default is 20) ;;
	
Examples:

PMult "x" "2*x" "1" "x"
PMult "x" "2*x" "1" "x" 30
PMult "x^2+x^3-2" "x^5-x" "-5*x^4" "x/7" "x"
-----------------------------------------

;; INDEFINITE INTEGRATION ;;

	PInteg poly var <pr>

;; Returns the indefinite integral of a real polynomial ;;

;; Arguments:
	;	poly (string): a real polynomial,
	;	var (string): the real variable of the polynomial as a string,
	;	pr (integer): the precision of the coefficients (optional and default is 20) ;;
	
Examples:

PInteg "x+x^2+x^3" "x"
-----------------------------------------

;; DEFINITE INTEGRATION ;;

	PDInteg poly a b var <pr>

;; Returns the definite integral of a real polynomial ;;

;; Arguments:
	;	poly (string): a real polynomial,
	;	a (string): the integral lower bound, could be a real expression as a string or a real number, for example, "cos(2)+3", "sin(4)", and "2". If the string is just a real constant such as "2" and "3", double quotes might be dropped,
	;	b (string): the integral upper bound, could be a real expression as a string or a real number,
	;	var (string): the real variable of the polynomial as a string,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

PDInteg "x+x^2+x^3" 1/3 1/2 "x" 26
PDInteg "(1/3)*x+0.5*x^2+5*x^3-x-x/7" 1/3 1/2 "x" 26
PDInteg "(1/3)*x+0.5*x^2+5*x^3-x-x/7" "2/3-1/3" 1/2 "x" 26


=============================
Real Symbolic Differentiation
=============================

	Der ex var n <a> <pr>

;; Returns the nth derivative (Symbolic or Numeric) ;;

;; Arguments:
	;	ex (string) : a real function expression,
	;	var (string) : the real variable of the function in lowercase,
	;	n (integer) : the order of the derivative,
	;	a (string) : a real value or real expression as a string to evaluate the nth derivative at (optional), for example, "cos(2)+3", "sin(4)", and "2". If the string is just a real constant such as "2" and "3", double quotes might be dropped,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

Der "sqrt(e^sin(x))" "x" 3
Der "sqrt(e^sin(x))" "x" 3 3 100
Der "e^(5/8*(sin(cos(tan(sec(csc(e^(3^x+e^-x/5/3*4))))))))" "x" 2 "0.5+1.5" 100


==========================
Taylor Model Computations
==========================

;; Taylor Model of a Real Function ;;

	TM ex var IntValue x0 n <pr>

;; Returns a Taylor Model of a real function around a point ;;

;; Arguments:
	;	ex (string): a real function expression,
	;	var (string): the real variable of the function in lowercase,
	;	IntValue (string): the Taylor Model interval or interval expression,
	;	x0 (string): a reference point as a real number or real expression, for example, "cos(2)+3", "sin(4)", and "2". If the string is just a real constant such as "2" and "3", double quotes might be dropped,
	;	n (integer): the Taylor Model order,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

TM "sin(x)*cos(x)" "x" "[-0.5,0.5]" 0 3 10
TM "sin(x)*cos(x)" "x" "[0.5,0.5]+[-1,0]" "0.5-0.5" 3 10
-----------------------------------------

;; Taylor Model Enclosure of the Image of a Real Function ;;

	TMImg ex var IntValue n <pr>

;; Returns the Taylor Model Image of a real function on a given interval ;;

;; Arguments:
	;	ex (string): a real function expression,
	;	var (string): the real variable of the function in lowercase,
	;	IntValue (string): the Taylor Model interval or interval expression (the function preimage),
	;	n (integer): the Taylor Model order,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

TMImg "(x^4-x^3-1)*cos(x)" "x" "[-0.2,0.1]" 3 10
TMImg "(x^4-x^3-1)*cos(x)" "x" "[-0.2,0]+[0,0.1]" 3 10
-----------------------------------------

;; Taylor Model Enclosure of a Definite Integral of a Real Function ;;

	TMInteg ex a b var n <pr>

;; Returns the Taylor Model Definite Integral of a real function on a given interval ;;

;; Arguments:
	;	ex (string): a real function expression,
	;	a (string): the integral lower bound, could be a real expression as a string or a real number, for example, "cos(2)+3", "sin(4)", and "2". If the string is just a real constant such as "2" and "3", double quotes might be dropped,
	;	b (string): the integral upper bound, could be a real expression as a string or a real number,
	;	var (string): the real variable of the function in lowercase,	
	;	n (integer): the Taylor Model order,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

TMInteg "x^2*sin(x)" 0.5 1 "x" 3 10
TMInteg "x^2*sin(x)" "0.2+0.3" "0.5+0.5" "x" 3 10


==================
The Gamma Function
==================

;; A Numerical Value of the Gamma Function ;;

	Gamma z <pr>
	
;; Arguments:
	;	z (string): gamma input, could be a real number or real expression as a string, for example, "cos(2)+3", "sin(4)", and "2". If the string is just a real constant such as "2" and "3", double quotes might be dropped,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

Gamma 0.5 (precision is defaulted to 20)
Gamma "-2+0.5" 30 (precision is 30)
-----------------------------------------

;; An Enclosure of the Exact Value of the Gamma Function ;;

	GammaEn z <pr>
	
;; Arguments:
	;	z (string): gamma input, could be a real number or real expression as a string, for example, "cos(2)+3", "sin(4)", and "2". If the string is just a real constant such as "2" and "3", double quotes might be dropped,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

GammaEn 0.5 (precision is defaulted to 20)
GammaEn "-2+0.5" 30 (precision is 30)


===================
Fractional Calculus
===================

;; An Enclosure of a Fractional Integral of Order Alpha > 0 ;;

	FIntegEn ex var alpha IntValue n <pr>

;; Returns an Enclosure of the Fractional Integral of Order Alpha > 0 ;;

;; Arguments:
	;	ex (string): a real function expression,
	;	var (string): the real variable of the function in lowercase,
	;	alpha (string): the order of the integral, could be a real number or real expression as a string, for example, "cos(2)+3", "sin(4)", and "2". If the string is just a real constant such as "2" and "3", double quotes might be dropped,
	;	IntValue (string): a domain interval or interval expression,
	;	n (integer): the degree of precision,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

FIntegEn "sin(x)" "x" 0.5 "[1.3,1.5]" 3 10
FIntegEn "e^x" "x" 1.5 "[1.3,1.5]" 3 10
FIntegEn "sin(x)" "x" "1-0.5" "[1.2,1.3]+[0.1,0.2]" 3 10
-----------------------------------------

;; An Enclosure of a Fractional Derivative of Order Alpha > 0 ;;

	FDerEn ex var alpha IntValue n <pr>

;; Returns an Enclosure of the Fractional Derivative of Order Alpha > 0 ;;

;; Arguments:
	;	ex (string): a real function expression,
	;	var (string): the real variable of the function in lowercase,
	;	alpha (string): the order of the derivative, could be a real number or real expression as a string, for example, "cos(2)+3", "sin(4)", and "2". If the string is just a real constant such as "2" and "3", double quotes might be dropped,
	;	IntValue (string): a domain interval or interval expression,
	;	n (integer): the degree of precision,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

FDerEn "sin(x)" "x" 0.5 "[1.3,1.5]" 3 10
FDerEn "e^x" "x" 1.5 "[1.3,1.5]" 3 10
FDerEn "sin(x)" "x" "1-0.5" "[1.2,1.3]+[0.1,0.2]" 3 10
-----------------------------------------

;; A Numerical Value of a Fractional Integral of Order Alpha > 0 ;;

	FInteg ex var alpha IntValue n <pr>

;; Returns a Numerical Value of the Fractional Integral of Order Alpha > 0 ;;

;; Arguments:
	;	ex (string): a real function expression,
	;	var (string): the real variable of the function in lowercase,
	;	alpha (string): the order of the integral, could be a real number or real expression as a string, for example, "cos(2)+3", "sin(4)", and "2". If the string is just a real constant such as "2" and "3", double quotes might be dropped,
	;	IntValue (string): a domain interval or interval expression,
	;	n (integer): the degree of precision,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

FInteg "sin(x)" "x" 0.5 "[1.3,1.5]" 3 10
FInteg "e^x" "x" 1.5 "[1.3,1.5]" 3 10
FInteg "sin(x)" "x" "1-0.5" "[1.2,1.3]+[0.1,0.2]" 3 10
-----------------------------------------

;; A Numerical Value of a Fractional Derivative of Order Alpha > 0 ;;

	FDer ex var alpha IntValue n <pr>

;; Returns a Numerical Value of the Fractional Derivative of Order Alpha > 0 ;;

;; Arguments:
	;	ex (string): a real function expression,
	;	var (string): the real variable of the function in lowercase,
	;	alpha (string): the order of the derivative, could be a real number or real expression as a string, for example, "cos(2)+3", "sin(4)", and "2". If the string is just a real constant such as "2" and "3", double quotes might be dropped,
	;	IntValue (string): a domain interval or interval expression,
	;	n (integer): the degree of precision,
	;	pr (integer): the precision of the result (optional and default is 20) ;;
	
Examples:

FDer "sin(x)" "x" 0.5 "[1.3,1.5]" 3 10
FDer "e^x" "x" 1.5 "[1.3,1.5]" 3 10
FDer "sin(x)" "x" "1-0.5" "[1.2,1.3]+[0.1,0.2]" 3 10


=============================================
Evaluation of an Entire File of InCL Commands
=============================================

	InCLEval filename

;; Evaluates a file of InCL commands ;;
;; Returns a new file (filename-InCLOut.txt) of InCL evaluations in the same path as the input file ;;
;; The default path of IO files is "C:\InCLData\IO" ;;

;; Arguments:
	;	filename (string): the name of the input file ;;

Example:

InCLEval "InCLInput.txt"


====================================================
Changing the Default Path for Input and Output Files
====================================================

	setInCLPath newPath

;; Changes the default path of IO files from "C:\InCLData\IO" to newPath ;;
;; Affects the location of InCLEval input and output files ;;

;; Arguments:
	;	newPath (string): the new path of InCL input and output files ;;

Example:

setInCLPath "newPath"
