ProgramInput<T>
Models & Types · AiDotNet.ProgramSynthesis.Models
Represents the input specification for program synthesis.
For Beginners
This class describes what you want the program to do.
When you want AI to create a program for you, you need to tell it what you want. This class lets you provide that information in different ways:
- Describe it in plain English
- Give examples of inputs and expected outputs
- Specify constraints (like “must run in under 1 second”)
Think of it like ordering at a restaurant - you tell the chef what you want, and they create the dish. This is how you tell the AI what program you want.
How It Works
ProgramInput encapsulates all the information needed to synthesize a program, including natural language descriptions, input-output examples, formal specifications, and constraints.
Constructors
| Constructor | Summary |
|---|---|
ProgramInput() |
Initializes a new instance of the ProgramInput class with default values. |
ProgramInput(string description, ProgramLanguage targetLanguage, List<ProgramInputOutputExample> examples, List<string> constraints) |
Initializes a new instance of the ProgramInput class. |
Properties
| Property | Summary |
|---|---|
List<ProgramInputOutputExample> Examples { get; set; } |
Gets or sets the input-output examples for inductive synthesis. |
List<ProgramInputOutputExample> TestCases { get; set; } |
Gets or sets the test cases for program validation. |
List<string> Constraints { get; set; } |
Gets or sets constraints that the synthesized program must satisfy. |
List<string> Tags { get; set; } |
Gets or sets metadata tags for categorizing or filtering synthesis tasks. |
ProgramLanguage TargetLanguage { get; set; } |
Gets or sets the target programming language for synthesis. |
Tensor<T> Encoding { get; set; } |
Gets or sets an encoded representation of the input for neural processing. |
int? MaxComplexity { get; set; } |
Gets or sets the maximum allowed complexity for the synthesized program. |
int? TimeoutMs { get; set; } |
Gets or sets the timeout for program synthesis in milliseconds. |
string Description { get; set; } |
Gets or sets the natural language description of the desired program. |
string FormalSpecification { get; set; } |
Gets or sets the formal specification in logic or a domain-specific language. |
Methods
| Method | Summary |
|---|---|
void AddConstraint(string constraint) |
Adds a constraint to the Constraints list. |
void AddExample(string input, string expectedOutput) |
Adds an input-output example to the Examples list. |
void AddTestCase(string input, string expectedOutput) |
Adds a test case to the TestCases list. |