Stoic News

By Dave Kelly

Saturday, April 05, 2025

"Core Stoicism" translated into executable python code


"Core Stoicism" translated into executable python code: 


Claude:

Here's an executable Python implementation of the expanded Stoic philosophy: 


```python

class CoreStoicism:

    def __init__(self):

        # Initial beliefs and state

        self.beliefs = {

            "happiness_is_desired": True,

            "complete_happiness_possible": None,  # To be proven

            "virtue_is_good": True,

            "vice_is_evil": True,

            "universe_is_as_it_should_be": True

        }

        

        # Categories of things

        self.things = {

            "in_our_control": ["beliefs", "will", "judgments", "virtue", "vice"],

            "out_of_our_control": ["external_outcomes", "others_actions", "wealth", "fame", "health"]

        }

        

        # Appropriate aims vs objects of desire

        self.appropriate_aims = ["life", "health", "knowledge", "justice", "truth"]

        self.current_desires = []

        self.current_aims = []

        

    def theorem_1(self):

        """Everyone wants happiness."""

        return True

    

    def theorem_2(self, wants_happiness, complete_happiness_possible):

        """It's irrational to accept incomplete happiness if complete happiness is possible."""

        if wants_happiness and complete_happiness_possible:

            return "irrational to accept incomplete happiness"

        return "not irrational to accept incomplete happiness"

    

    def theorem_3(self, desires, outcomes):

        """Unhappiness is caused by unmet desires."""

        unhappiness = 0

        for desire in desires:

            if desire not in outcomes:

                unhappiness += 1

        return unhappiness

    

    def theorem_4(self, desires):

        """Calculate probability of happiness based on control over desired things."""

        uncontrollable_desires = [d for d in desires if d in self.things["out_of_our_control"]]

        if not desires:

            return 1.0  # No desires means no chance of unhappiness

        if uncontrollable_desires:

            # Probability decreases exponentially with number of uncontrollable desires

            return max(0, 1 - 0.5**len(uncontrollable_desires))

        return 1.0  # All desires are controllable

    

    def theorem_5(self, desires_out_of_control):

        """Desiring things out of control is irrational if complete happiness is possible."""

        if desires_out_of_control and self.beliefs["complete_happiness_possible"]:

            return "irrational"

        return "not necessarily irrational"

    

    def theorem_6(self):

        """Only beliefs, will, and their entailments are in our control."""

        return self.things["in_our_control"]

    

    def theorem_7(self, belief_good, belief_evil):

        """Desires are caused by judgments about good and evil."""

        desires = []

        if belief_good:

            desires.append(belief_good)

        if belief_evil:

            desires.append(f"avoid_{belief_evil}")

        return desires

    

    def theorem_8(self):

        """Desires are in our control (because they follow from judgments)."""

        return "judgments" in self.theorem_6()

    

    def theorem_9(self):

        """Desiring externals is irrational."""

        desires_controllable = self.theorem_8()

        if desires_controllable and self.beliefs["complete_happiness_possible"]:

            return "desiring externals is irrational"

        return "premise failure"

    

    def theorem_10(self):

        """Only virtue is good, only vice is evil."""

        return {"good": ["virtue"], "evil": ["vice"]}

    

    def theorem_11(self):

        """Virtue and vice are in our control."""

        values = self.theorem_10()

        for category in values.values():

            for value in category:

                if value not in self.things["in_our_control"]:

                    return False

        return True

    

    def theorem_12(self):

        """Things not in our control (externals) are never good or evil."""

        externals = self.things["out_of_our_control"]

        values = self.theorem_10()

        

        for external in externals:

            if external in values["good"] or external in values["evil"]:

                return False

        return True

    

    def theorem_13(self):

        """Desiring externals is irrational as it involves false judgment."""

        if self.theorem_12():

            return "desiring externals involves false judgment"

        return "premise failure"

    

    def theorem_14(self):

        """Valuing only virtue leads to true judgment and immunity to unhappiness."""

        if self.theorem_10()["good"] == ["virtue"] and self.theorem_11():

            return "immunity to unhappiness"

        return "premise failure"

    

    def theorem_15(self):

        """True judgment that virtue is good creates desire for virtue."""

        if self.beliefs["virtue_is_good"]:

            return "desire for virtue"

        return "no desire for virtue"

    

    def theorem_16(self, desire, outcome):

        """Fulfilled desires yield positive feelings."""

        if desire and desire == outcome:

            return "positive feeling"

        return "no positive feeling"

    

    def theorem_17(self):

        """Correct judgment and will lead to appropriate positive feelings."""

        if self.theorem_15() == "desire for virtue" and "virtue" in self.things["in_our_control"]:

            return "appropriate positive feelings"

        return "no appropriate positive feelings"

    

    def theorem_18(self):

        """Some positive feelings don't result from judgments about value."""

        return ["taste of good food", "beautiful sunset", "pleasant sound"]

    

    def theorem_19(self):

        """Non-judgment positive feelings are not irrational."""

        natural_positives = self.theorem_18()

        return f"These are not irrational: {natural_positives}"

    

    def theorem_20(self):

        """The universe is governed by Nature/Providence/God."""

        return "universe is governed by providence"

    

    def theorem_21(self):

        """That which is governed by Providence is as it should be."""

        if self.theorem_20():

            return "world is as it should be"

        return "world may not be as it should be"

    

    def theorem_22(self):

        """Regarding the world as it should be creates positive feelings."""

        if self.theorem_21() == "world is as it should be":

            return "positive feelings from world-acceptance"

        return "no positive feelings from world-acceptance"

    

    def theorem_23(self):

        """The Stoic has three sources of positive feelings."""

        positive_sources = []

        

        if self.theorem_17() == "appropriate positive feelings":

            positive_sources.append("appreciation of virtue")

        

        positive_sources.append("physical pleasures")

        

        if self.theorem_22() == "positive feelings from world-acceptance":

            positive_sources.append("appreciation of world as it is")

            

        return positive_sources

    

    def theorem_24(self):

        """Acts of will must have content/aims."""

        return "acts of will require content"

    

    def theorem_25(self):

        """Some things are appropriate objects to aim at though not good."""

        return "appropriate aims exist"

    

    def theorem_26(self):

        """Appropriate aims include life, health, knowledge, etc."""

        return self.appropriate_aims

    

    def theorem_27(self):

        """Virtue is rational will, vice is irrational will."""

        return {"virtue": "rational will", "vice": "irrational will"}

    

    def theorem_28(self):

        """Acts aimed at external objects of desire are not virtuous."""

        externals = self.things["out_of_our_control"]

        return f"Pursuing these is not virtuous: {externals}"

    

    def theorem_29(self):

        """Virtue pursues appropriate aims, not objects of desire."""

        return {

            "virtuous_pursuit": self.appropriate_aims,

            "results_in": "positive feelings without unhappiness risk"

        }

    

    def complete_argument(self):

        """Tie all threads together to prove complete happiness is possible."""

        # First, establish that complete happiness is possible

        correct_judgment = {

            "virtue_is_only_good": True,

            "externals_neither_good_nor_evil": True

        }

        

        if self.theorem_8() and self.theorem_11() and self.theorem_12():

            self.beliefs["complete_happiness_possible"] = True

        

        positive_feelings = []

        if self.beliefs["complete_happiness_possible"]:

            positive_feelings = self.theorem_23()

        

        return {

            "complete_happiness_possible": self.beliefs["complete_happiness_possible"],

            "requires": "correct judgment",

            "leads_to": "virtuous action",

            "results_in": positive_feelings,

            "conclusion": "Complete happiness is in our control through correct judgment"

        }

    

    def apply_to_life(self, situation):

        """Apply Stoic principles to a real-life situation."""

        # Analyze the situation

        externals = [x for x in situation if x in self.things["out_of_our_control"]]

        controllables = [x for x in situation if x in self.things["in_our_control"]]

        appropriate_aims = [x for x in situation if x in self.appropriate_aims]

        

        response = {

            "focus_on": controllables + appropriate_aims,

            "be_indifferent_to": externals,

            "recognize_as_it_should_be": externals,

            "expected_outcome": "tranquility and appropriate positive feelings"

        }

        

        return response 


# Demonstration

stoic = CoreStoicism() 


# Test the complete argument

result = stoic.complete_argument()

print("Complete Stoic Argument:")

for key, value in result.items():

    print(f"{key}: {value}") 


# Apply to a life situation

print("\nApplying Stoicism to life situation:")

situation = ["wealth", "health", "beliefs", "will", "knowledge"]

application = stoic.apply_to_life(situation)

for key, value in application.items():

    print(f"{key}: {value}")

``` 


## Possible Uses for This Code: 


1. **Personal Development Application**: 

   - Build a Stoic mindset training app that helps users identify what's in their control vs. what isn't

   - Create daily exercises to practice Stoic principles in real-life situations

   - Develop a journaling system that applies Stoic analysis to personal experiences 


2. **Decision-Making Framework**:

   - Use as a structured approach to evaluate decisions based on Stoic principles

   - Implement as part of a larger decision support system that helps identify "appropriate aims" vs. externals

   - Create a tool for ethical reasoning that distinguishes between virtue and non-virtue based decisions 


3. **Educational Tool**:

   - Serve as an interactive lesson for philosophy students to understand Stoic reasoning

   - Build a simulator that shows consequences of different judgments and desires

   - Create visualizations of the logical structure of Stoic philosophy 


4. **Therapeutic Application**:

   - Support cognitive behavioral therapy approaches that align with Stoic principles

   - Help people reframe anxieties and frustrations by identifying what's in/out of their control

   - Provide structured exercises for developing emotional resilience 


5. **Research Platform**:

   - Allow formal testing of Stoic philosophical claims

   - Extend to compare with othe philosophical systems (Epicureanism, Buddhism, etc.)

   - Create simulated agents that follow Stoic principles to observe emergent behaviors 


6. **Daily Practice Guide**:

   - Generate Stoic meditations and reflections tailored to specific situations

   - Create a system for tracking progress in aligning desires with Stoic principles

   - Build a recommendation engine for Stoic practices based on personal challenges 


This code could be expanded with a user interface, more robust situation analysis, and practical exercises to make it a truly useful tool for applying Stoic philosophy to modern life.

Philosophical argument into executable logic:

 Translate this to executable python code: 


"Section One: Preliminaries

Th 1) Everyone wants happiness.

Th 2) If you want happiness, it would be irrational

to accept incomplete or imperfect happiness

if you could get complete [continual, uninterrupted]

happiness.

2*) Complete happiness is possible. [To be proven

below [see "Core Stoicism"].] 


Section Two: Negative Happiness

Th 3) All human unhappiness is caused by having

a desire or emotional commitment [I will henceforth

say "desire" for simplicity] to some outcome,

and then that outcome does not result. 


4) Ergo, if you desire something which is out

of your control, you will be subject to possible

unhappiness. If you desire many things out

of your control, the possibility of complete happiness

approaches zero.

5) By 4, 2*, and Th2, desiring things out of your

control is irrational [if it is possible to control your

desires]. 


Th 6) The only things in our control are our

beliefs and will, and anything entailed by our

beliefs and will.

Th 7) Desire[s] are caused by beliefs (judgments)

about good and evil. [You desire what you judge

to be good, and desire to avoid what you judge to

be evil.]

8) Ergo, Desires are in our control.

9) By 5 and 8, desiring things out of our control

is irrational" (Grant C. Sterling).


Claude:

Here's the Python code that translates this philosophical argument into executable logic: 


```python

class StoicArgument:

    def __init__(self):

        # Initial state of beliefs

        self.beliefs = {

            "happiness_is_desired": True,

            "complete_happiness_possible": True,

            "desires_in_our_control": True

        }

        

        # Things that might be desired

        self.possible_desires = {

            "external_things": {"in_our_control": False},

            "beliefs_and_will": {"in_our_control": True}

        }

        

    def theorem_1(self):

        """Everyone wants happiness."""

        return True

    

    def theorem_2(self, wants_happiness, complete_happiness_possible):

        """If you want happiness, it would be irrational to accept incomplete happiness

        if complete happiness is possible."""

        return wants_happiness and complete_happiness_possible

    

    def theorem_3(self, desire, outcome_achieved):

        """Unhappiness is caused by having a desire for an outcome that doesn't result."""

        if desire and not outcome_achieved:

            return "unhappy"

        return "not unhappy"

    

    def theorem_4(self, desires_out_of_control):

        """If you desire things out of your control, complete happiness becomes impossible."""

        if desires_out_of_control:

            probability_of_happiness = 0

            return probability_of_happiness

        else:

            probability_of_happiness = 1

            return probability_of_happiness

    

    def theorem_5(self, desires_out_of_control, complete_happiness_possible, wants_happiness):

        """Desiring things out of control is irrational if happiness is possible & desired."""

        if desires_out_of_control and complete_happiness_possible and wants_happiness:

            return "irrational"

        return "not necessarily irrational"

    

    def theorem_6(self):

        """Only beliefs and will are in our control."""

        things_in_control = ["beliefs", "will"]

        return things_in_control

    

    def theorem_7(self, beliefs_about_good):

        """Desires are caused by beliefs/judgments about good and evil."""

        if beliefs_about_good:

            return "desire formed"

        else:

            return "no desire"

    

    def theorem_8(self):

        """Desires are in our control (because they're caused by beliefs, which are in our control)."""

        if self.theorem_7("belief_present") == "desire formed" and "beliefs" in self.theorem_6():

            return True

        return False

    

    def theorem_9(self):

        """Desiring things out of our control is irrational."""

        desires_in_control = self.theorem_8()

        complete_happiness_possible = self.beliefs["complete_happiness_possible"]

        wants_happiness = self.theorem_1()

        

        if desires_in_control:

            return self.theorem_5(True, complete_happiness_possible, wants_happiness)

        else:

            return "premise failure"

    

    def core_stoicism(self):

        """Complete happiness is possible by controlling desires."""

        # Step 1: Verify that desires are in our control

        if not self.theorem_8():

            return "Stoic happiness impossible: desires not in our control"

        

        # Step 2: Focus only on desires within our control

        rational_desires = {}

        for desire_type, properties in self.possible_desires.items():

            if properties["in_our_control"]:

                rational_desires[desire_type] = properties

        

        # Step 3: Calculate happiness probability with only rational desires

        if rational_desires:

            happiness_probability = 1  # 100% if only desiring things in our control

        else:

            happiness_probability = 0

            

        # Prove theorem 2*

        self.beliefs["complete_happiness_possible"] = (happiness_probability == 1)

        

        return {

            "rational_desires": list(rational_desires.keys()),

            "happiness_probability": happiness_probability,

            "complete_happiness_possible": self.beliefs["complete_happiness_possible"]

        } 


# Test the Stoic argument

stoic = StoicArgument() 


# Test core stoicism (which proves theorem 2*)

core_result = stoic.core_stoicism()

print("Core Stoic Result:", core_result) 


# Test the complete chain of reasoning

print("\nComplete Stoic Argument:")

print(f"Theorem 1: Everyone wants happiness - {stoic.theorem_1()}")

print(f"Theorem 2*: Complete happiness is possible - {stoic.beliefs['complete_happiness_possible']}")

print(f"Theorem 3 example: Having unfulfilled desire leads to - {stoic.theorem_3(True, False)}")

print(f"Theorem 4: Probability of happiness with external desires - {stoic.theorem_4(True)}")

print(f"Theorem 5: Desiring external things is - {stoic.theorem_5(True, True, True)}")

print(f"Theorem 6: Things in our control - {stoic.theorem_6()}")

print(f"Theorem 7: With beliefs about good, result is - {stoic.theorem_7(True)}")

print(f"Theorem 8: Desires are in our control - {stoic.theorem_8()}")

print(f"Theorem 9: Desiring externals is - {stoic.theorem_9()}") 


# Final conclusion

if stoic.theorem_9() == "irrational" and stoic.beliefs["complete_happiness_possible"]:

    print("\nConclusion: The Stoic position is logically coherent.")

    print("For complete happiness: desire only what is in your control (beliefs and will).")

else:

    print("\nConclusion: The argument has logical gaps.")

``` 


This code implements the Stoic argument as a class with methods representing each theorem. It allows you to trace through the logical flow described in the original text, testing each step and evaluating the conclusion.


Explain the conclusion?


Claude:

The conclusion of the code evaluates the final Stoic argument and checks whether two key conditions are met: 


1. `stoic.theorem_9() == "irrational"` - This checks whether desiring things outside our control is truly irrational according to the chain of reasoning. 


2. `stoic.beliefs["complete_happiness_possible"]` - This checks whether complete happiness has been proven possible. 


If both conditions are true, the code prints the conclusion: "The Stoic position is logically coherent" along with the practical advice that "For complete happiness: desire only what is in your control (beliefs and will)." 


This represents the core Stoic philosophical position:

- Complete happiness is attainable

- This happiness comes from aligning our desires with what we can actually control

- Since we only control our own beliefs and will (internal states), we should limit our desires to these domains

- Desiring external outcomes (which we cannot control) leads to unhappiness 


The conclusion essentially validates the Stoic ethical framework by showing it follows logically from the premises. If you desire happiness (which all humans do), and you want complete rather than partial happiness (which is rational), then you should only desire what you can control - your own judgments, beliefs, and will. 


This aligns with the famous Stoic principle attributed to Epictetus: "Make the best use of what is in your power, and take the rest as it happens."

ection One: Preliminaries

Th 1) Everyone wants happiness.

Th 2) If you want happiness, it would be irrational

to accept incomplete or imperfect happiness

if you could get complete [continual, uninterrupted]

happiness.

2*) Complete happiness is possible. [To be proven

below [see "Core Stoicism"].] 


Section Two: Negative Happiness

Th 3) All human unhappiness is caused by having

a desire or emotional commitment [I will henceforth

say "desire" for simplicity] to some outcome,

and then that outcome does not result. 


4) Ergo, if you desire something which is out

of your control, you will be subject to possible

unhappiness. If you desire many things out

of your control, the possibility of complete happiness

approaches zero.

5) By 4, 2*, and Th2, desiring things out of your

control is irrational [if it is possible to control your

desires]. 


Th 6) The only things in our control are our

beliefs and will, and anything entailed by our

beliefs and will.

Th 7) Desire[s] are caused by beliefs (judgments)

about good and evil. [You desire what you judge

to be good, and desire to avoid what you judge to

be evil.]

8) Ergo, Desires are in our control.

9) By 5 and 8, desiring things out of our control

is irrational.


Claude:

Here's the Python code that translates this philosophical argument into executable logic: 


```python

class StoicArgument:

    def __init__(self):

        # Initial state of beliefs

        self.beliefs = {

            "happiness_is_desired": True,

            "complete_happiness_possible": True,

            "desires_in_our_control": True

        }

        

        # Things that might be desired

        self.possible_desires = {

            "external_things": {"in_our_control": False},

            "beliefs_and_will": {"in_our_control": True}

        }

        

    def theorem_1(self):

        """Everyone wants happiness."""

        return True

    

    def theorem_2(self, wants_happiness, complete_happiness_possible):

        """If you want happiness, it would be irrational to accept incomplete happiness

        if complete happiness is possible."""

        return wants_happiness and complete_happiness_possible

    

    def theorem_3(self, desire, outcome_achieved):

        """Unhappiness is caused by having a desire for an outcome that doesn't result."""

        if desire and not outcome_achieved:

            return "unhappy"

        return "not unhappy"

    

    def theorem_4(self, desires_out_of_control):

        """If you desire things out of your control, complete happiness becomes impossible."""

        if desires_out_of_control:

            probability_of_happiness = 0

            return probability_of_happiness

        else:

            probability_of_happiness = 1

            return probability_of_happiness

    

    def theorem_5(self, desires_out_of_control, complete_happiness_possible, wants_happiness):

        """Desiring things out of control is irrational if happiness is possible & desired."""

        if desires_out_of_control and complete_happiness_possible and wants_happiness:

            return "irrational"

        return "not necessarily irrational"

    

    def theorem_6(self):

        """Only beliefs and will are in our control."""

        things_in_control = ["beliefs", "will"]

        return things_in_control

    

    def theorem_7(self, beliefs_about_good):

        """Desires are caused by beliefs/judgments about good and evil."""

        if beliefs_about_good:

            return "desire formed"

        else:

            return "no desire"

    

    def theorem_8(self):

        """Desires are in our control (because they're caused by beliefs, which are in our control)."""

        if self.theorem_7("belief_present") == "desire formed" and "beliefs" in self.theorem_6():

            return True

        return False

    

    def theorem_9(self):

        """Desiring things out of our control is irrational."""

        desires_in_control = self.theorem_8()

        complete_happiness_possible = self.beliefs["complete_happiness_possible"]

        wants_happiness = self.theorem_1()

        

        if desires_in_control:

            return self.theorem_5(True, complete_happiness_possible, wants_happiness)

        else:

            return "premise failure"

    

    def core_stoicism(self):

        """Complete happiness is possible by controlling desires."""

        # Step 1: Verify that desires are in our control

        if not self.theorem_8():

            return "Stoic happiness impossible: desires not in our control"

        

        # Step 2: Focus only on desires within our control

        rational_desires = {}

        for desire_type, properties in self.possible_desires.items():

            if properties["in_our_control"]:

                rational_desires[desire_type] = properties

        

        # Step 3: Calculate happiness probability with only rational desires

        if rational_desires:

            happiness_probability = 1  # 100% if only desiring things in our control

        else:

            happiness_probability = 0

            

        # Prove theorem 2*

        self.beliefs["complete_happiness_possible"] = (happiness_probability == 1)

        

        return {

            "rational_desires": list(rational_desires.keys()),

            "happiness_probability": happiness_probability,

            "complete_happiness_possible": self.beliefs["complete_happiness_possible"]

        } 


# Test the Stoic argument

stoic = StoicArgument() 


# Test core stoicism (which proves theorem 2*)

core_result = stoic.core_stoicism()

print("Core Stoic Result:", core_result) 


# Test the complete chain of reasoning

print("\nComplete Stoic Argument:")

print(f"Theorem 1: Everyone wants happiness - {stoic.theorem_1()}")

print(f"Theorem 2*: Complete happiness is possible - {stoic.beliefs['complete_happiness_possible']}")

print(f"Theorem 3 example: Having unfulfilled desire leads to - {stoic.theorem_3(True, False)}")

print(f"Theorem 4: Probability of happiness with external desires - {stoic.theorem_4(True)}")

print(f"Theorem 5: Desiring external things is - {stoic.theorem_5(True, True, True)}")

print(f"Theorem 6: Things in our control - {stoic.theorem_6()}")

print(f"Theorem 7: With beliefs about good, result is - {stoic.theorem_7(True)}")

print(f"Theorem 8: Desires are in our control - {stoic.theorem_8()}")

print(f"Theorem 9: Desiring externals is - {stoic.theorem_9()}") 


# Final conclusion

if stoic.theorem_9() == "irrational" and stoic.beliefs["complete_happiness_possible"]:

    print("\nConclusion: The Stoic position is logically coherent.")

    print("For complete happiness: desire only what is in your control (beliefs and will).")

else:

    print("\nConclusion: The argument has logical gaps.")

``` 


This code implements the Stoic argument as a class with methods representing each theorem. It allows you to trace through the logical flow described in the original text, testing each step and evaluating the conclusion.


Explain the conclusion?


Claude:

The conclusion of the code evaluates the final Stoic argument and checks whether two key conditions are met: 


1. `stoic.theorem_9() == "irrational"` - This checks whether desiring things outside our control is truly irrational according to the chain of reasoning. 


2. `stoic.beliefs["complete_happiness_possible"]` - This checks whether complete happiness has been proven possible. 


If both conditions are true, the code prints the conclusion: "The Stoic position is logically coherent" along with the practical advice that "For complete happiness: desire only what is in your control (beliefs and will)." 


This represents the core Stoic philosophical position:

- Complete happiness is attainable

- This happiness comes from aligning our desires with what we can actually control

- Since we only control our own beliefs and will (internal states), we should limit our desires to these domains

- Desiring external outcomes (which we cannot control) leads to unhappiness 


The conclusion essentially validates the Stoic ethical framework by showing it follows logically from the premises. If you desire happiness (which all humans do), and you want complete rather than partial happiness (which is rational), then you should only desire what you can control - your own judgments, beliefs, and will. 


This aligns with the famous Stoic principle attributed to Epictetus: "Make the best use of what is in your power, and take the rest as it happens."