# Smart Contract Generation Assisted by AI-Based Word Segmentation
## 4 Ai-Assisted Smart Contract Generation Approach (AIASCG)
### Smart Contract Generation Approach Comparison
\begin{table}
\begin{tabular}{p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt} p{56.9 pt}} \hline \hline
**Approach Type** & \begin{tabular}{c} **Input Word** \\ **Segmentation** \\ \end{tabular} & \begin{tabular}{c} **Human Effort in** \\ **Contract Drafting** \\ \end{tabular} & \begin{tabular}{c} **Expressiveness of Smart** \\ **Contract Specification** \\ \end{tabular} & \
\begin{tabular}{c} **Validation Capacity** \\ **of a Generation Approach** \\ \end{tabular} &
\begin{tabular}{c} **Output Executability** \\ \end{tabular} \\ \hline Arbitrary constraints to smart contracts & \(\mathrm{N/A}\) & Very demanding & Program code correctness & Can validate correctness hard to validate truthfulness, & Not executable as smart contract selection: Limited executability as scripted-base languages: High executability as fluring-complete languages \\ \hline Formally specified constraints to smart contracts & \(\mathrm{N/A}\) & Demanding & Program code correctness hard to validate truthfulness & Not executable as smart contract selection: Limited executability as scripted-base languages: High executability as Turing-complete languages \\ \hline Business processes as smart contracts & \(\mathrm{N/A}\) & Demanding & Key business process parameters & Can validate correctness and truthfulness theoretically & Logically executable \\ \hline Legal agreements as smart contracts & \(\mathrm{N/A}\) & Demanding & Temporal and operational constraints & Can validate correctness and truthfulness theoretically & Logically executable \\ \hline AIASCG & Yes & Less demanding & Obligation constraints as specified by IDLC & Can validate correctness and truthfulness theoretically, human readability and understandability & Logically executable as specified by IDLC \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of smart contract generation methods. validation, on one hand, requires understanding the semantic of the generated smart contracts; therefore, it is closely related to the human readability and understandability of the generation output. Because computer codes are not intuitive to be read and understood, supporting techniques such as formal semantic of codes [56] are required to mitigate this drawback. On the other hand, a logical smart contract that is the output of BP-SC and LA-SC is easier to validate its truthfulness because a logical representation is easier to read and understand. For AIASCG, the generated MNL contracts are not only readable and understandable by a human but can also be translated into different human natural languages, allowing language-agnostic human validation. Finally, _output executability_ evaluates if the smart contract produced by a generation approach can be executed as a computer program. For AC-SC and FC-SC, which generate smart contract codes as output, the codes are not always directly executable, because the generation results can be smart contract skeletons that require manual completion of its core execution logic [15]. Meanwhile, the implementation of executable smart contract codes can be based on script-based languages (e.g., BitML [58] and Simplicity [59]) or Turing-complete languages (e.g., Solidity ([[https://soliditylang.org/](https://soliditylang.org/)]([https://soliditylang.org/](https://soliditylang.org/)), accessed on 20 April 2022). As argued in [60], script-based languages are limited to executing financial transactions, whereas Turing-complete languages are more versatile. As for BP-SC and LA-SC, the output as logical smart contracts can achieve logical execution, i.e., the formally specified rules and instructions. Although their implementations may only produce smart contract code skeletons [17; 19; 54], with the logical smart contract as the intermediate representation, the logical execution can be decoupled with the implementation details, allowing more flexible and complex smart contract development. For AIASCG, the generated SSCs can also achieve logical execution as described in [7].