Skip to content

Latest commit

 

History

History
146 lines (101 loc) · 9.62 KB

File metadata and controls

146 lines (101 loc) · 9.62 KB

Symbolic Prompting - Variables (For Educationl Use Only)

Status GitHub Stars YouTube Playlist YouTube Playlist YouTube Playlist
License-MIT Methodology-V2 Benchmark

[ 🌎 English ] | [ 🇲🇽 Español Latino ]

🏠 Home

There exist different way to define variables as part of Symbolic Prompt.

Use Atomic, Unambiguous Names

GOOD BAD
essay_difficulty_level
feedback_required
student_grade_level
level Thing
status
grade

Apply Consistent Naming Conventions

CONVENTION PURPOSE EXAMPLE
snake_case Mutable variables essay_difficulty_level
UPPER_SNAKE_CASE Constants / ENUM types DIFFICULTY_LEVEL
PascalCase Types / schemas EssayType
lowercase values Free text (limited) "literary analysis"
UPPERCASE values ENUM members BEGINNER, INTERMEDIATE, ADVANCED

Syntax of Names

DEFINITION INTERPRETER EXAMPLE
TYPE_ESSAY = Constant / Enum Global / Value not change TYPE_ESSAY = NARRATIVE | EXPOSITORY | ARGUMENTATIVE
type_essay = Variable or Constant / Update value type_essay = {narrative, expository, argumentative, descriptive}
Type_Essay = {... Type or Class Type_Essay = Narrative | Expository | Argumentative
TypeEssay = {... Type or Class TypeEssay = {
category: EssayCategory,
word_count: Integer,
required_sections: List }
Compact Syntax Not Recommended typeessay={lit,pers,exp,desc}

Variable Definition Method Comparison

METHOD SYNTAX BEST FOR EXAMPLE LLM CLARITY
Explicit Typing variable: Type = value Formal systems, type safety difficulty: DifficultyLevel = Intermediate High
Set Membership variable ∈ {values} Discrete choices, enumerations essay_type ∈ {Narrative, Expository, Persuasive} High
Mathematical Range variable ∈ [min..max] Numerical ranges, intervals min_pass_score ∈ [70..80] High
Assignment variable = value Simple values, constants min_pass_score = 70 Medium-High
Definition variable := expression Derived values, aliases passing := student_score ≥ min_pass_score Medium
Predicate Form is_property(variable) Boolean conditions, flags is_advanced(essay) Medium
Structured variable = {field: value} Objects, records, entities essay = {id: "E123", type: Persuasive, score: 85} High

Variable Definition Patterns by Use Case 

USE CASE RECOMMENDED PATTER EXAMPLE WHY IT WORKS
Essay Classification Enumeration with membership difficulty_level ∈ {Beginner, Intermediate, Advanced, Expert} Clear categories, easy validation
Lesson Planning Structured objects lesson_plan = {topic: String, duration: Minutes, objectives: List<String>, materials: List<String>} Captures complex relationships
Student Assessment Derived booleans is_proficient := (score ≥ 80) ∧ (completion_rate ≥ 0.9) Computable conditions
Assignment Management Typed variables with ranges due_date: Date ∈ [today..today+7] Quantitative constraints
Curriculum Design Set operations advanced_topics ⊆ all_topics ∩ (math_topics ∪ science_topics) Mathematical precision
Essay Evaluation Predicate functions has_thesis_statement(essay) Functional approach

Symbol Selection for Variable Types

VARIABLE TYPE RECOMMENDED SYMBOL EXAMPLE ALTERNATIVE
Enumeration ∈ {values} essay_type ∈ {Narrative, Expository} : EnumType
Range ∈ [min..max] grade_level ∈ [1..12] : NumberRange
Boolean : Boolean has_conclusion: Boolean ∈ {true, false}
String : String student_name: String = "value"
Integer : Integer page_count: Integer ∈ ℤ
Float : Float essay_score: Float ∈ ℝ
List : List<Type> topics: List<String> = [value1, value2]
Set : Set<Type> prerequisites: Set<Course> ⊆ {values}
Object : ObjectType submission: StudentWork = {field: value}

Declare Domains

GOOD BAD
DIFFICULTY_LEVEL = {BEGINNER, INTERMEDIATE, ADVANCED, EXPERT}
essay_difficulty in DIFFICULTY_LEVEL
d = {b, i, a, e}
essay_difficulty = advanced

Prefer Closed Sets (ENUM) Over free Text

GOOD BAD
feedback_type in {GRAMMAR, STRUCTURE, CONTENT, CITATIONS} feedback_type = "whatever the essay needs"

Boolean Flags

GOOD BAD
needs_revision = true revision_status = "pending"
has_thesis = false thesis_present = "no"
is_plagiarized = false plagiarism_check = "clean"

Avoid Reassigning Constants

Constants define ontology, not state.

GOOD BAD
DIFFICULTY_LEVEL = {BEGINNER, INTERMEDIATE, ADVANCED, EXPERT}
essay_difficulty = ADVANCED
DIFFICULTY_LEVEL = ADVANCED

⚖️ Legal Disclaimer (Click to expand)

This repository is for educational purposes only regarding Symbolic Prompting. The author is not responsible for the use that third parties may make of these techniques. The user is responsible for respecting the terms of service of AI platforms and applicable legislation. All content is provided "AS IS," without warranties.
Compatibility may vary depending on model updates, tokenization behavior, and symbol parsing.


⭐ If this class helped you think differently about LLMs, consider starring the repository.


Author

Contributors

🏠 Home