Thread: My functional syllogism program

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    308

    My functional syllogism program

    I will now run the program and input 5 custom sentences and then print them below so you can see how much sense the program makes:

    Code:
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no gandalf is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accredited are gandalf.
    no accredited is here
    
    Celaront
    
    no gandalf is here.
    accredited are gandalf.
    Some accredited are not here
    
    Felapton
    
    no gandalf is here.
    accredited are gandalf.
    Some gandalf are not here
    
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no bad is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no bad is here.
    abominably are bad.
    no abominably is here
    
    Celaront
    
    no bad is here.
    abominably are bad.
    Some abominably are not here
    
    Felapton
    
    no bad is here.
    abominably are bad.
    Some bad are not here
    
    Close program? [1=yes, 0=no]:
    Code:
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no good is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no good is here.
    openminded are good.
    no openminded is here
    
    Celaront
    
    no good is here.
    openminded are good.
    Some openminded are not here
    
    Felapton
    
    no good is here.
    openminded are good.
    Some good are not here
    
    Close program? [1=yes, 0=no]:
    Code:
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no commontater is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no commontater is here.
    accolade are commontater.
    no accolade is here
    
    Celaront
    
    no commontater is here.
    accolade are commontater.
    Some accolade are not here
    
    Felapton
    
    no commontater is here.
    accolade are commontater.
    Some commontater are not here
    
    Close program? [1=yes, 0=no]:
    Code:
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no smith is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no smith is here.
    internship are smith.
    no internship is here
    
    Celaront
    
    no smith is here.
    internship are smith.
    Some internship are not here
    
    Felapton
    
    no smith is here.
    internship are smith.
    Some smith are not here
    
    Close program? [1=yes, 0=no]:
    These are the names of the text files in the program that are in the same folder but blank:
    backup.txt
    readlist.txt
    readtext1.txt
    readtext.txt
    writelist.txt

    The file called "readfile.txt" is to hold the wordlist used in the search function.
    You need this list to run the program.
    You can get this list from sourceforge, google "kevins word list" and get the "Official 12Dicts Package".
    I use the file from the Official 12Dicts Package called "2 of 12", I just copy and paste the list into the readfile.txt.

    Now I'm not sure what to do next since this was for AI, but I will think about what to do next.
    I'm sorry if you think this work is not valuable, I am not being malicious in giving this to you.

    Remove the txt extension and unzip the file to get the source.
    new.zip.txt

    I had some fun and used commontater in the program to see the results and was pleased with the results so I decided to post it in one of the examples above.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    What unimatrix number was that in, and did it have the defect of individuality? (little Star Trek NG joke there).

    Props Jeremy!

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    308
    Here is my new syllogism program.

    The difference now is there is a different result if you run the program and when it asks if the syllogism was good and you choose "no" the next time that syllogism is input into the program a different answer is given.

    The program remembers bad answers and doesn't give the same answer again, it only gives the good answer this way.

    I will now run the program and print the results belwo so you can see what I'm talking about.

    Code:
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accomplished are gandalf.
    no accomplished is here
    
    Celaront
    
    no gandalf is here.
    accomplished are gandalf.
    Some accomplished are not here
    
    Felapton
    
    no gandalf is here.
    accomplished are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    0
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accord are gandalf.
    no accord is here
    
    Celaront
    
    no gandalf is here.
    accord are gandalf.
    Some accord are not here
    
    Felapton
    
    no gandalf is here.
    accord are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    0
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accordance are gandalf.
    no accordance is here
    
    Celaront
    
    no gandalf is here.
    accordance are gandalf.
    Some accordance are not here
    
    Felapton
    
    no gandalf is here.
    accordance are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    0
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accordant are gandalf.
    no accordant is here
    
    Celaront
    
    no gandalf is here.
    accordant are gandalf.
    Some accordant are not here
    
    Felapton
    
    no gandalf is here.
    accordant are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    0
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    according are gandalf.
    no according is here
    
    Celaront
    
    no gandalf is here.
    according are gandalf.
    Some according are not here
    
    Felapton
    
    no gandalf is here.
    according are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    Code:
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accordingly are gandalf.
    no accordingly is here
    
    Celaront
    
    no gandalf is here.
    accordingly are gandalf.
    Some accordingly are not here
    
    Felapton
    
    no gandalf is here.
    accordingly are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    Code:
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accordion are gandalf.
    no accordion is here
    
    Celaront
    
    no gandalf is here.
    accordion are gandalf.
    Some accordion are not here
    
    Felapton
    
    no gandalf is here.
    accordion are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    0
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accordionist are gandalf.
    no accordionist is here
    
    Celaront
    
    no gandalf is here.
    accordionist are gandalf.
    Some accordionist are not here
    
    Felapton
    
    no gandalf is here.
    accordionist are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    0
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accredit are gandalf.
    no accredit is here
    
    Celaront
    
    no gandalf is here.
    accredit are gandalf.
    Some accredit are not here
    
    Felapton
    
    no gandalf is here.
    accredit are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    Code:
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accreditation are gandalf.
    no accreditation is here
    
    Celaront
    
    no gandalf is here.
    accreditation are gandalf.
    Some accreditation are not here
    
    Felapton
    
    no gandalf is here.
    accreditation are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    0
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .


    Then after ten results the program stops giving results. Because after ten of them the results start to get fuzzy.


    Code:
    Type 1 to run the program
    1
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no gandalf is here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    1
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .


    Here is the link to the code and program: _syllogism machine.zip

    There are seven text files:
    readfile.txt, this is the file that holds the wordlist from sourcforge "kevins word list".
    readlist.txt, blank.
    readtext.txt, blank.
    readtext1.txt, blank.
    writelist, blank.
    m_and_s.txt, blank.
    bad.txt, blank but then the program builds it up over times used.
    Then the source file, new.c.

    Here's the current source code, remove the txt extension and unzip it: new.zip.txt

  4. #4
    Registered User
    Join Date
    Apr 2011
    Posts
    308
    In case you don't know, syllogisms require two sentences, a major and minor premise.
    This program only requires one sentence and makes a syllogism.

    I fixed a error where one of the results wasn't being made.
    And I tweaked the results a bit so they are better.
    And I added a default result in case the tweaked result didn't have enough returns to work.

    I will list only five results below, then if you want you can try some of your own.

    Code:
    Type 1 to run the program
    1
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no pervert is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no pervert is here.
    endoscopy are pervert.
    no endoscopy is here
    
    Celaront
    
    no pervert is here.
    endoscopy are pervert.
    Some endoscopy are not here
    
    Felapton
    
    no pervert is here.
    endoscopy are pervert.
    Some pervert are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    1
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    Type 1 to run the program
    1
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no gandalf is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    acidic are gandalf.
    no acidic is here
    
    Celaront
    
    no gandalf is here.
    acidic are gandalf.
    Some acidic are not here
    
    Felapton
    
    no gandalf is here.
    acidic are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    0
    Close program? [1=yes, 0=no]: 0
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no gandalf is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no gandalf is here.
    accomplished are gandalf.
    no accomplished is here
    
    Celaront
    
    no gandalf is here.
    accomplished are gandalf.
    Some accomplished are not here
    
    Felapton
    
    no gandalf is here.
    accomplished are gandalf.
    Some gandalf are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    1
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    Type 1 to run the program
    1
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no socom is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no socom is here.
    octopus are socom.
    no octopus is here
    
    Celaront
    
    no socom is here.
    octopus are socom.
    Some octopus are not here
    
    Felapton
    
    no socom is here.
    octopus are socom.
    Some socom are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    1
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    Type 1 to run the program
    1
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no saint is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no saint is here.
    abundant are saint.
    no abundant is here
    
    Celaront
    
    no saint is here.
    abundant are saint.
    Some abundant are not here
    
    Felapton
    
    no saint is here.
    abundant are saint.
    Some saint are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    1
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Code:
    Type 1 to run the program
    1
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no adak is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no adak is here.
    acidic are adak.
    no acidic is here
    
    Celaront
    
    no adak is here.
    acidic are adak.
    Some acidic are not here
    
    Felapton
    
    no adak is here.
    acidic are adak.
    Some adak are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    0
    Close program? [1=yes, 0=no]: 0
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    
    
    
    Enter a sentence, all lower case.
    Rename X and Y with words, the new word must have both a letter and vowel in it.
    
    Formats of sentences:
    
    A.)X are Y
    B.)no X is Y
    C.)some X are not Y
    
    no adak is here
    
    __________________________________________
    
    Type Felapton (EAO-3) or Celarent (EAE-1) or Celaront (EAE-1) Syllogism pattern
    found
    No M is P
    S are M or M are S
    
    
    Celarent
    
    no adak is here.
    accomplished are adak.
    no accomplished is here
    
    Celaront
    
    no adak is here.
    accomplished are adak.
    Some accomplished are not here
    
    Felapton
    
    no adak is here.
    accomplished are adak.
    Some adak are not here
    
    Was the syllogism logical? 1 for yes, 0 for no:
    1
    Close program? [1=yes, 0=no]: 1
    Press any key to continue . . .
    Here is the link to the source and program: syllogism machine.zip

    In case you want to dl the newest source here instead of the link, here it is: new.zip.txt

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I finished my syllogism project
    By jeremy duncan in forum C Programming
    Replies: 3
    Last Post: 12-04-2011, 10:35 AM
  2. Need advice, program no longer fully functional.
    By bchaffin72 in forum Linux Programming
    Replies: 3
    Last Post: 10-21-2010, 03:51 PM
  3. functional derivation better?
    By CodeMonkey in forum C++ Programming
    Replies: 3
    Last Post: 08-16-2007, 12:57 AM
  4. Functional programming languages... r they really functional?
    By code_mutant in forum C++ Programming
    Replies: 10
    Last Post: 02-25-2004, 05:29 AM
  5. functional dependencies
    By DMaxJ in forum C++ Programming
    Replies: 10
    Last Post: 10-23-2002, 07:07 AM