Author Topic: PSeInt (pseudo code interpreter) a tool for learning logic programming  (Read 19770 times)

0 Members and 1 Guest are viewing this topic.

Offline CompSystems

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +7/-4
  • HP48GX,HP50G and TInspireCAS Calculator Programmer
    • View Profile
    • HP48GX,HP50G and TInspireCAS Calculator Programmer
Hello, I invite ta check this new tool written in C++ (pseudo-code interpreter), Volunteers wanted to translate it to English and other languages



PSeInt is a tool for learning logic programming oriented to students with no experience in computer programming. Using a pseudo-language, intuitive, can begin to understand basic concepts and principles of a computer algorithm, Also allows export to C++, create edit and export to flow chart, step to step running, and CODING and EXECUTION in REAL TIME *.*  :crazy:  :o  and much more

Source code and home page
http://pseint.sourceforge.net/



http://en.wikipedia.org/wiki/Quadratic_function
[ Invalid YouTube link ]
« Last Edit: April 03, 2013, 07:50:39 am by CompSystems »

Offline jwalker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 660
  • Rating: +13/-0
  • Almost everything I have released includes a 'WZ'
    • View Profile
Re: PSeInt a tool for learning logic programming
« Reply #1 on: March 30, 2013, 02:44:47 pm »
nice
<a href="http://www.nerdtests.com/ft_cg.php?im">
<img src="http://www.nerdtests.com/images/ft/cg.php?val=9612" alt="My computer geek score is greater than 41% of all people in the world! How do you compare? Click here to find out!"> </a>

Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads

Offline CompSystems

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +7/-4
  • HP48GX,HP50G and TInspireCAS Calculator Programmer
    • View Profile
    • HP48GX,HP50G and TInspireCAS Calculator Programmer
« Last Edit: April 03, 2013, 07:57:25 am by CompSystems »

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: PSeInt a tool for learning logic programming
« Reply #3 on: April 03, 2013, 07:45:39 am »
That's pretty nice. I hope you make an English version though.

Offline CompSystems

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +7/-4
  • HP48GX,HP50G and TInspireCAS Calculator Programmer
    • View Profile
    • HP48GX,HP50G and TInspireCAS Calculator Programmer
can also be used to export code to TI-BASIC
http://sourceforge.net/p/pseint/code/ci/302b3dd55782df9400af44104bd5ffe0db1fc27a/tree/psexport/

// file 1 example

/
Code: [Select]
/  export_chooser.h file

#ifndef EXPORT_CHOOSER_H
#define EXPORT_CHOOSER_H
#include <string>
#include "defines.h"
using namespace std;

enum PSE_LANG { PSE_CPP, PSE_HP_Basic, PSE_TI_Basic };


string translate_function(const string &name, const string &args);
void translate_main(t_programa &prog, t_algoritmo &alg);

extern PSE_LANG language;

#endif

// File 2
/// export_chooser.cpp file
Code: [Select]
#include "export_chooser.h"
#include "export_cpp.h"
#include "export_HP_Basic.h"
#include "export_TI_Basic.h"

// PSE_LANG language=PSE_CPP; // C++ language (default )

// PSE_LANG language=HP_Basic; // HP_Basic language
PSE_LANG language=TI_Basic; // TI_Basic language

string translate_function(const string &name, const string &args) {
  switch (PSE_LANG) {
   PSE_CPP:
return cpp_function(name,args);
                break;



          PSE_HP_Basic:

                return HP_Basic_function(name,args);

                break;

 PSE_TI_Basic:

                return TI_Basic_function(name,args);

                break;
      
  }
}

void translate_main(t_programa & prog, t_algoritmo & alg) {
 

        switch (PSE_LANG) {
  PSE_CPP:
cpp_main(prog,alg);

                return;
                break;



         PSE_HP_Basic:


                HP_Basic_main(prog,alg);

                return;

                break;

PSE_HP_Basic:


                TI_Basic_main(prog,alg);

                return;

                break;

  }
}

// File 3

// export_HP_Basic.h


Code: [Select]
#ifndef EXPORT_HP_Basic_H
#define EXPORT_HP_Basic_H
#define EXPORT_TI_Basic_H

#include "defines.h"

/**
* @brief traduce la llamada a una función predefinida a HP_Basic
*
* @param name    nombre de la función en pseudocódigo
* @param args    string con la lista de argumentos (incluye los paréntesis)
**/
string TI_Basic_function(string name, string args);



/**
* @brief traduce el algoritmo a TI_Basic
*
* @param prog    argumento de salida, donde colocar las instrucciones traducidas
* @param alg     argumento de entrada, con el algoritmo ya parseado
**/
void TI_Basic_main(t_programa &prog, t_algoritmo &alg);

#endif
« Last Edit: April 03, 2013, 03:01:58 pm by CompSystems »

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Could you post export_TI_Basic.h ? The code excerpts that you've posted so far are clearly C++ (string, namespace, passing arguments by reference), but GCC4TI doesn't support C++.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Here's the little intro text:
PSeInt is a tool to learn logic programming, geared towards students without any prior experience in logic programming. Through the use of a limited, simple, and intuitive pseudo-language (in Spanish), one can begin to learn and understand the basic fundamental concepts of a computer algorithm. Originally conceived as the final project for the Programming I course of the Computer Engineering degree in the Faculty of Engineering and Water Sciences at the National University of the Littoral, it is actually a pseudocode interpreter based on the contents of the Fundamentals of Programming class of the same degree.

Sólo una cosa, no entiendo muy bien qué significa aquí cátedra, supongo que no es tan importante pero yo siempre pensé que una "cátedra" era como el trabajo de un "catedrático", pero me parece que aquí no tiene mucho sentido...

I can start translating the documentation, if you want :)

Offline CompSystems

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +7/-4
  • HP48GX,HP50G and TInspireCAS Calculator Programmer
    • View Profile
    • HP48GX,HP50G and TInspireCAS Calculator Programmer
>> chickendude
>> Sólo una cosa, no entiendo muy bien qué significa aquí cátedra
Catedra también significa Curso o Asignatura; cátedra de Fundamentos de Programación == Curso de Fundamentos de Programación

>>I can start translating the documentation, if you want 

English:
Currently PSeInt only supports pseudocode in Spanish  :(
To create a version in English (pseudocode in English or another language) is required to made a parallel program current development PSeInt_ENG  :)



Spanish:
Actualmente PSeint solo soporta PSeudoCode en Spanish
Para crear una versión en English se requiere crear un programa paralelo al actual desarrollo

Example: Spanish
http://sourceforge.net/p/pseint/code/ci/302b3dd55782df9400af44104bd5ffe0db1fc27a/tree/pseint/new_evaluar.cpp#l14

file: new_evaluar.cpp   

Code: [Select]
bool PalabraReservada(const string &str) {
// Comprobar que no sea palabra reservada
if (word_operators && (str=="Y" || str=="O" || str=="NO" || str=="MOD"))
return true;
if (str=="LEER" || str=="ESCRIBIR" || str=="MIENTRAS" || str=="HACER" || str=="SEGUN" || str=="VERDADERO" || str=="FALSO" || str=="PARA")
return true;
if (str=="REPETIR" || str=="SI" || str=="SINO" || str=="ENTONCES" ||   str=="DIMENSION" || str=="PROCESO")
return true;
if (str=="FINSI" ||  str=="FINPARA" || str=="FINSEGUN" || str=="FINPROCESO" || str=="FINMIENTRAS" ||  str=="HASTA" || str=="DEFINIR" || str=="COMO")
return true;
if (str=="FIN" ||  str=="IMPRIMIR" || str=="BORRAR" || str=="LIMPIAR" || str=="PANTALLA" ||  str=="BORRARPANTALLA" || str=="LIMPIARPANTALLA")
return true;
if (str=="SIN" || str=="BAJAR" || str=="SINBAJAR" || str=="SALTAR" || str=="SINSALTAR")
return true;
return false;
}
...

ENG: The same code above with keywords in English
SPN: El mismo código anterior en English

file: new_eval.cpp
Code: [Select]
bool KeyWord(const string &str) {
// Check that there is not keyword
if (word_operators && (str=="AND" || str=="OR" || str=="NOT" || str=="MODULE"))
return true;
if (str=="READ" || str=="WRITE" || str=="WHILE" || str=="DO" || str=="SWITCH" || str=="TRUE" || str=="FALSE" || str=="FOR")
return true;
if (str=="REPEAT" || str=="IF" || str=="ELSE" || str=="THEN" ||   str=="DIMENSION" || str=="PROCESS")
return true;
if (str=="IFEND" ||  str=="FOREND" || str=="SWITCHEND" || str=="PROCESSEND" || str=="WHILEEND" ||  str=="TO" || str=="DEFINE" || str=="AS")
return true;
if (str=="END" ||  str=="PRINT" || str=="DELETE" || str=="CLEAR" || str=="CLEANSCREEN" ||  str=="SCREEN" || str=="DELSCREEN ")
return true;
if (str=="WITHOUT" || str=="DOWN" || str==" WITHOUT DOWN" || str=="SKIP" || str=="WITHOUTSKIP")
return true;
return false;
}
...

SPN:
Programas en pseudocode hay muchos en la internet, pero lo valioso de este software es que mientras se codifica o se re-edita se ejecuta sin necesidad de volver a lanzar el programa desde el inicio, además genera un diagrama de flujo editable. Así que vale la pena llevar este software a INGLES u otro lenguaje.

Se requiere de muchas personas, para traducir el código fuente, la interface etc, además que es compilable con Win,LINUX y MAC

Otra ayuda seria, crear extensiones para exportar a VisualBasic, JAVA, LUA, TI-BASIC, etc, por que actualmente solo exporta a C++

Thanks
« Last Edit: April 03, 2013, 02:37:13 pm by CompSystems »

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
By writing the code differently, there could be a single source code which handles multiple languages, through either simple collections of defines activated one at a time (easy, that's what multiple TI-Chess Team programs do) and multiple binaries which speak a single language, or using time-proven solutions such as gettext's libraries (that's what libti*/gfm/tilp and tiemu do). Multiple independent but similar source files are a maintenance nightmare.

If the authors want to have the best chances of attracting contributors and translators, the code base (function and variable names, comments) should be entirely written in English :)
« Last Edit: April 03, 2013, 02:33:21 pm by Lionel Debroux »
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Nice. Can this tool be used to learn languages such as Z80 assembly without a single high-level language knowledge first or would it be better than someone still learns another language first with this before switching to ASM?

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: PSeInt (pseudo code interpreter) a tool for learning logic programming
« Reply #10 on: April 04, 2013, 03:13:35 am »
Here are two new parts:
Spoiler For Documents and Manuals:
Documents and Manuals:
For the documentation of the newest versions, consult the following sections of the site:
   Characteristics and Functions
   PseudoCode
   Examples
   Screen Captures
More details can be found in the in-program help.

Other related links:
   GPL licence under which the software's distributed.
   Changelog to see what's new in each version.
   List of known bugs: errors known to be present in the latest available version.
   Timeline: a summary of the major milestones in the life of this project.   
   Cucarachas Racing is a blog where I publish information about my projects (among which is PSeInt) in a somewhat disorganized manner, sharing both technical information (about programming) as well as information directed towards the end user (about functions and decisions on design).

About...
PSeInt - copyleft 2003-2013 (by Pablo Novara - zaskar_84<arroba>yahoo.com.ar)

Special thanks to those who helped in the revival of this project in its early stages (Román Gelbort, Adrián Staffolani, Patricia Chechele, Horacio Loyarte, Joaquín Duo, et al), and many other professors and students who sent in daily error reports and suggestions online or by e-mail.
Spoiler For Characteristics and Functions:
What purpose does PSeInt serve?
   PSeInt was designed to help students who are just getting started in creating computer programs and/or algorithms. Pseudocode is generally used as one's first contact to introduce basic concepts such as the use of control structures, expressions, variables, etc., without having to deal with the particularities in the syntax of a real language. This software attempts to facilitate the task of writing algorithms in this pseudolanguage by offering a wide array of help and assistance and providing aditional tools to help locate errors and understand the logic behind the algorithms.
   
Characteristics and Functions of PSeInt:

   Editing tools to write algorithms in pseudocode (in Spanish)
      Autocompletion
      Pop-up Help Dialogs
      Command Templates
      Syntax Highlighting
      Smart/Autoindent
   Generation and editing of the algorithm's flow charts
   Simultaneous editing of multiple algorithms
   Pseudocode language is configurable
      Offers predefined configuration profiles for many institutions
   Can interpret (ie. execute) the algorithms you write
      Step-by-step execution of an algorithm, controlling speed and monitoring variables and expressions
      Can automatically prepare a table listing the state of variables throughout the execution of your program
   Determines and clearly marks syntax errors as you type and during execution
   Allows the conversion of the algorithm to C++
   Offers an integrated help system about the psuedocode and how to use the program
      Includes a set of examples with differing difficulty levels
   Multiplatform (tested on Microsoft Windows, GNU/Linux, and Mac OS X)
   100% free (GPL license)

To translate some of the other parts, it might be worthwhile to translate some of the instructions first, for example AZAR could become RAND or RANDOM, SENO (a funny name :P) could become SINE, etc.

EDIT: And @DJ_O: i still don't think it's really necessary to study another language first before starting ASM (i never did and still haven't ;)), though i don't see how this would help you learn z80 assembly... I'd be interested to hear about that though :)
« Last Edit: April 04, 2013, 03:24:54 am by chickendude »

Offline CompSystems

  • LV3 Member (Next: 100)
  • ***
  • Posts: 68
  • Rating: +7/-4
  • HP48GX,HP50G and TInspireCAS Calculator Programmer
    • View Profile
    • HP48GX,HP50G and TInspireCAS Calculator Programmer
Vote for PSeInt, the SourceForge June 2013 Project of the Month

http://twtpoll.com/ublez9