Showing posts with label Discrete Structures. Show all posts

What is difference between predicate logic, proportional logic and first order predicate logic?


  1. Predicate Logic: Predicate logic is the general form of all logics that uses predicates, like q(x). Here q is predicate. Predicate logic supports the ability to have variables, and quantifiers. For example, xy.p(x,y) means "For all x there exists a y such that the proposition p(x,y) is true".
  2. Propositional Logic: Propositional logic means without ability to do predication. For example, in P ^ Q, both p and q are propositions. 
  3. First order predicate logic:In first-order predicate logic, variables can appear only inside a predicate. That is, you can quantify over variables, but not predicates themselves. In second-order logic, you can also quantify over predicates, e.g. px.p(x)¬p(x) is true: for every predicate p, either p(x) or not p(x) is true, regardless of what x is.
Learn more »

Why is C programming very popular?

C programming is very popular because of the following factors:

  •  C is ubiquitous. C is available for all the platform, in most of the cases.
  •  C is portable.  If you write a piece of clean C, and it compiles with minimal modifications on other platforms - sometimes it even works out-of-the-box.
  • C is still the default language for UNIX and UNIX-like systems. If you want a library to succeed in open-source land, you need fairly good reasons not to use C. This is partially due to tradition, but more because C is the only language you can safely assume to be supported on any UNIX-like system. Writing your library in C means you can minimize dependencies.
  • C is simple. It lacks the expressivity of sophisticated OOP or functional languages, but its simplicity means it can be picked up quickly.
  • C is versatile. It is suitable for embedded systems, device drivers, OS kernels, small command-line utilities, large desktop applications, DBMS's, implementing other programming languages, and pretty much anything else you can think of.
  • C is fast. Most C implementations compile directly to machine code, and the programmer has full power over what happens at the machine level. There is no interpreter, no JIT compiler, no VM or runtime - just the code, a compiler, a linker, and the bare metal.
  • C is 'free' . There is no single company that owns and controls the standard, there are several implementations to choose from, there are no copyright, patenting or trademark issues for using C, and some of the best implementations are open-source.
  • C has a lot of momentum going. The is an huge amount of applications, libraries, tools, and most of all, communities, to support the language.
  • C is mature. The last standard that introduced big changes is C99, and it is mostly backwards-compatible with previous standards. Unlike newer languages , we don't have to worry about breaking changes anytime soon.
  •  C has been around for a while. Back in the days when UNIX conquered the world, C (the UNIX programming language of choice) shared in its world domination, and became the linuga franca of the programming world. Any serious programmer can be expected to at least make some sense of a chunk of C; the same can't be said about most other languages.
  • C is base programming language: Many other programming languages are the offshoots of C programming language.

Learn more »

Prove the following Boolean expression:


Proved the expression

Learn more »