Saturday, February 17, 2007

LogicC#.net continue

3-How does LogicC#.Net differs from other languages?
The traditional computer languages, such as C++, C and Pascal, are procedural languages.
In a procedural language, the programmer must provide step by step instructions that tell the computer exactly how to solve a given problem. In other words, the programmer must know how to solve the problem before the computer can do it.
In logic language like Prolog programmer, on the other hand, only needs to supply a description of the problem and the ground rules for solving it but the problem is when the problem is related to business as the programmer needs to access more resources like printers, database servers and more.
The difficulties are found in logic languages like Prolog to do that.
LogicC#.net is not a traditional or logic based language but it combines the power of both so the programmer can benefit from logic concepts like matching and backtracking and the power of procedural in computations and resources access.
-LogicC#.Net can deduce the output.
As LogicC#.Net contains an inference engine that responsible for deduction


4-The Advantages of LogicC#.Net
-Hybrid Coding Environment (logic & procedural)
In LogicC#.Net the developer can develop the application using two views logic& procedural and traverse from two environments using bridges.
The powerful of logic#.net is the capability to do environmental switching as the developer can write logic code that will be used in procedural code and vice versa.
Example:(environment switching demonstration)
Logic(int id;string name;double salary)
{
CheckName(name,id,salary);
id>5;
}
Apply
{
Salary*=2;
Updatedata(name,id,salary);
Display(salary);
}
The previous code demonstrates the environment bridge that helps developer to switch from logic to procedural environment and vice versa.
Keyword logic tells the compiler that the followed code will be executed at logic environment.
Keyword apply tells the compiler that the followed code will be executed at logic environment.

-Pure object oriented
1- All codes are placed inside classes.
2-Supporting object orientation concepts for both procedural and logic (inheritance, polymorphism, encapsulation).
Example :( object oriented in logic#.net demonstration)
namespace businessmen
{
public logicclass project
{
}
public logicclass man
{
public string name;
public logic isbusinessman()
{
}

}
class mainclass
{
static void Main()
{
}
}
}


Example:
namespace businessmen
{
public logicclass project
{
Public float budget;
}
public logicclass man
{
public string name;
protected float weight;
private project proj;
public logic isbusinessman(project p)
{
p.budget>30000;
}
}
class mainclass
{
static void Main()
{
logic()
{
Man m;
project p;
p.budget=100000;
m.man(p);
}
apply
{
write("he is business man");
}
}
}
}

-code reusability
-Short development time
In LogicC#.Net the number of program lines required to solve a given problem is typically only a fraction of that required by other language like C++ or prolog. Clearly this can reduce development costs considerably, and since the code is easier to modify, ongoing maintenance costs are often lower as well.

-Easy manipulation of complex data structures
-Automatic memory management (garbage collection)
-Based on .Net framework.
As LogicC#.Net is based on .Net framework so it supports all .net classes and facilities like
-XML.
-Sockets
-Reflections and others
-Supporting SQL databases
LogicC#.Net provides the programmer the capability to connect to sql servers and work with databases in simple ways rather than other languages as it is based on RAD (rapid application development).

No comments: