
Constraint programming (CP)[1] is a paradigm for solving combinatorial problems that draws on a wide range of techniques from artificial intelligence, computer science, and operations research. In constraint programming, users declaratively state the constraints on the feasible solutions for a set of decision variables. Constraints differ from the common primitives of imperative programming languages in that they do not specify a step or sequence of steps to execute, but rather the properties of a solution to be found. In addition to constraints, users also need to specify a method to solve these constraints. This typically draws upon standard methods like chronological backtracking and constraint propagation, but may use customized code like a problem-specific branching heuristic.But before proceeding, let’s be clear that PML is not required to use Veloce CPQ. PML knowledge is not necessary to use Veloce because Veloce CPQ uses a front end UI that is point and click and requires no code. However, we find that Developers and System Integrators prefer working in our proprietary object-oriented modeling language when building the rules for products. Let’s get back to the story of training ChatGPT. The reason I am curious if ChatGPT can learn PML is because PML is an incredibly easy and fast way of writing rules for CPQ systems. Here’s why: For example, when building a product model, If you need to create a new or similar rule, in PML, you can copy and paste the rule and very quickly create your new rule. And in PML it’s very easy and quick to go back to modify rules.
Training ChatGPT
I decided I wanted to have a crack at training ChatGPT. To do so, I had a conversation with ChatGPT to determine if I could train it. I started with some PML examples. Since PML is a proprietary object oriented product modeling language and ChatGPT wasn’t pre-trained with PML before. I first had to explain to ChatGPT what PML is. Here is my interaction with ChatGPT.First Interaction with ChatGPT
Me: PML is an object oriented product modeling languageChatGPT: I’m sorry, but I’m not familiar with PML as a specific product modeling language. Can you provide some additional context or information about PML, such as its purpose or intended use case? This would help me better understand what PML is and how it is used.
Me: it is used to describe the product structure, constraint and rule for the productChatGPT: Ah, I see. PML, or Product Modeling Language, is a domain-specific language used to model the structure, constraints, and rules of a product in a formal and precise way. PML can be used to describe various aspects of a product, including its physical structure, behavior, and relationships with other products. This information can then be used for various purposes, such as for simulation, analysis, design, or manufacturing.
PML can also be used as an intermediary format to exchange information between different tools, systems, or stakeholders in a product development process. This helps ensure consistency and accuracy of information throughout the product life cycle.
It’s worth noting that while PML is a useful tool for product modeling, it is just one of many tools available and the choice of modeling language often depends on the specific needs and requirements of the product being modeled.
What ChatGPT Says about PML and CPQ Systems
Me: PML is used in CPQ systems where sales reps can configure, and price the quote.ChatGPT: Yes, that’s correct! PML is often used in CPQ (Configure, Price, Quote) systems to model and automate the product configuration, pricing, and quoting process for complex products. A CPQ system that uses PML can help sales representatives and customers quickly and accurately configure and price products, taking into account constraints, rules, and interdependencies of various options and features.
PML can provide a precise and standardized representation of product information, making it easier for the CPQ system to calculate prices, generate quotes, and validate configurations. This can result in increased efficiency, accuracy, and consistency in the sales process, and can also help improve the customer experience by reducing errors and streamlining the configuration and quoting process.
Me: What is PML?ChatGPT: PML stands for “Product Modeling Language.” It is a language used to describe the structure, constraints, and rules of a product. PML is commonly used in computer-aided design (CAD) and product configuration software, such as CPQ (Configure, Price, Quote) systems. In these systems, PML is used to define the parameters of a product and the relationships between them, so that the software can be used to configure, price, and quote the product to customers. PML provides a way to represent complex products and their configurations in a concise and structured manner, which enables efficient and accurate product design and configuration.
Me: Can you write a blog about PML?ChatGPT: Sure, here’s a sample blog about PML:
Product Modeling Language (PML): A Guide to Efficient Product Configuration
PML, or Product Modeling Language, is a language used to describe the structure, constraints, and rules of a product. It provides a standard way to represent complex products and their configurations in a concise and structured manner. PML is commonly used in computer-aided design (CAD) and product configuration software, such as CPQ (Configure, Price, Quote) systems.
The use of PML in product configuration software allows sales reps to quickly and accurately configure, price, and quote products to customers. By representing the parameters of a product and the relationships between them in a PML model, the software can automatically determine which configurations are possible and which are not. This helps to ensure that only valid configurations are presented to the customer, which saves time and reduces errors.
PML models can be simple or complex, depending on the product being modeled. For example, a simple PML model might only describe the basic structure of a product, such as the number of components and their types. A more complex PML model, on the other hand, might describe the constraints and rules that govern the product’s configuration, such as the minimum and maximum number of components, the relationships between components, and the impact of certain components on the product’s price.
Creating a PML model can be a time-consuming and complex process, but it is essential for ensuring that the product configuration software is accurate and efficient. The PML model serves as the foundation for the product configuration software, and it must be carefully crafted to accurately reflect the product and its configurations.
Once the PML model has been created, it can be used as the basis for a number of different product configuration applications. For example, the PML model can be used to generate product configuration wizards, which guide the user through the configuration process. It can also be used to generate technical drawings, BOMs (Bill of Materials), and pricing information.
In conclusion, PML is a powerful tool for product configuration, and it is an essential component of many CAD and CPQ systems. By using PML to describe the structure, constraints, and rules of a product, it is possible to create efficient and accurate product configuration software, which can help to reduce errors and save time.
You can see ChatGPT learned the PML concept quickly and even wrote a blog about PML. Now I decided to train it with one PML example.
Me: define max_size 24 @(split=”TRUE”) type queen { int col = [1..max_size]; int row = [1..max_size]; int d2; int d1; int size = parent(n); constraint(row<=size, “Row number exceeds board size”); constraint(col<=size, “Column number exceeds board size”); constraint(d1==col+row); constraint(d2==col-row); } type board { @(defaultValue=”8″) int n = [4..max_size]; port position : queen [4..max_size] { } constraint(n==position[queen]); constraint(distinct(position.col)); constraint(distinct(position.d1)); constraint(distinct(position.d2)); sequential(position.row); }ChatGPT: This code is written in what appears to be a modeling language and is defining a problem to solve the 8-queen problem, where the goal is to place 8 queens on a chess board such that no two queens threaten each other. The code creates two types, “queen” and “board”.
The “queen” type defines the column and row where a queen is placed on the chess board, and two diagonal properties d1 and d2, which are used to enforce the constraint that no two queens can be placed on the same diagonal.
The “board” type represents the chess board and contains an array of “queen” objects. The board type defines several constraints to enforce the rules of the problem. These constraints include:
- A queen must be placed in a column and row within the size of the board
- No two queens can be in the same column or the same diagonal
- The queens must be placed in sequential order by row.
The code defines a max_size of 24, which represents the maximum size of the chess board that can be used in the solution.
You can see ChatGPT understood the PML perfectly. I asked ChatGPT to write a PML for the 8 queen problem. It did it. Me: write PML for 8 queen problemChatGPT: The following is an example of a PML code to solve the 8 queen problem:
define max_size 24
@(split=”TRUE”)
type queen {
int col = [1..max_size];
int row = [1..max_size];
int d2;
int d1;
int size = parent(n);
constraint(row<=size, “Row number exceeds board size”);
constraint(col<=size, “Column number exceeds board size”);
constraint(d1==col+row);
constraint(d2==col-row);
}
type board {
@(defaultValue=”8″)
int n = [4..max_size];
port position : queen [4..max_size] {
}
constraint(n==position[queen]);
constraint(distinct(position.col));
constraint(distinct(position.d1));
constraint(distinct(position.d2));
sequential(position.row);
}
In this code, the queen type is used to represent the position of each queen on the chessboard, where col and row represent the column and row numbers, respectively. The d1 and d2 fields represent the diagonal positions of the queen. The board type is used to represent the chessboard, where n is the size of the board and position is an array of queen type elements that represent the position of each queen on the board. The constraints constraint(distinct(position.col)), constraint(distinct(position.d1)), and constraint(distinct(position.d2)) ensure that no two queens can occupy the same row, the same column, or the same diagonal. The sequential(position.row) constraint ensures that the queens are placed on the board one row at a time.
Because I think ChatGPT may remember the PML for 8 queens it might not be a big deal. I want to try something different. I decided to ask ChatGPT to write PML based on product description and see if it can do it. Me: House has a lot of rooms. Each room has attribute width, length and area. Area is equal to multiplication of width and length. There are different kinds of rooms like Bath room, bed room, dining room, living room, game room, etc. Write PML to describe a house.ChatGPT: Here’s an example of how you could write PML to describe a house:
type Room {
float width = [1.0, 100.0];
float length = [1.0, 100.0];
float area = width * length;
}
type House {
Room rooms[1, 1000];
constraint(rooms.area > 0, “Area must be greater than zero”);
}
type Bedroom : Room {}
type Bathroom : Room {}
type DiningRoom : Room {}
type LivingRoom : Room {}
type GameRoom : Room {}
This PML code defines several types of rooms (Bedroom, Bathroom, DiningRoom, LivingRoom, GameRoom), each of which is a type of Room. Each Room has an attribute for width, length, and area, where the area is calculated as the product of the width and length. The House type has an array of rooms, and a constraint that ensures the area of each room is greater than zero.