当前位置: 首页 > news >正文

Lustre Core 语法 - 布尔表达式

Lustre v6 中的 Lustre Core 部分支持的表达式种类中,支持布尔表达式。相关的表达式包括and, or, xor, not, #, nor

相应的文法定义为

Expression ::=  not Expression| Expression and Expression| Expression or Expression | Expression xor Expression | # (ExpressionList) | nor (ExpressionList)

and 与运算

and 运算符表示与运算,使用样例如下

function andExpr(a,b: bool) returns (c: bool)
letc = a and b;
tel

or 或运算

or 运算符表示或运算,使用样例如下

function orExpr(a,b: bool) returns (c: bool)
letc = a or b;
tel

xor 异或运算

xor 运算符表示异或运算,使用样例如下

function xorExpr(a, b: bool) returns (c: bool)
letc = a xor b;
tel

not 取反运算

not 运算符表示取反运算,使用样例如下

function notExpr (i: bool) returns (o: bool)
leto = not i;
tel

# sharp 运算

# 运算符的输入为布尔变量列表,列表中至多有一项true 时,表达式输出为 true,反之为 false。

function sharp(i1,i2,i3: bool) returns (o: bool)
leto = #(i1, i2, i3);
tel

nor 运算

nor 运算符的输入为布尔变量列表,列表中无 true 时,表达式输出为 true,反之为 false。

function norExpr(a,b,c: bool) returns (o: bool)
leto = nor (a,b,c);
tel
http://www.lryc.cn/news/528216.html

相关文章:

  • python学opencv|读取图像(四十六)使用cv2.bitwise_or()函数实现图像按位或运算
  • C# 添加、替换、提取、或删除Excel中的图片
  • 工作总结:压测篇
  • 11JavaWeb——SpringBootWeb案例02
  • vs2022+tesseract ocr识别中英文 编译好的库下载
  • 状态模式——C++实现
  • 3.观察者模式(Observer)
  • Kotlin判空辅助工具
  • Electron学习笔记,安装环境(1)
  • 将 OneLake 数据索引到 Elasticsearch - 第 1 部分
  • 【C++】STL介绍 + string类使用介绍 + 模拟实现string类
  • Hive:基本查询语法
  • 日志收集Day008
  • 【解决方案】VMware虚拟机adb连接宿主机夜神模拟器
  • 基于金融新闻的大型语言模型强化学习在投资组合管理中的应用
  • 脚本运行禁止:npm 无法加载文件,因为在此系统上禁止运行脚本
  • 借DeepSeek-R1东风,开启创业新机遇
  • C# lock使用详解
  • 简易CPU设计入门:控制总线的剩余信号(四)
  • 使用 lock4j-redis-template-spring-boot-starter 实现 Redis 分布式锁
  • 22_解析XML配置文件_List列表
  • 编译器gcc/g++ --【Linux基础开发工具】
  • 58.界面参数传递给Command C#例子 WPF例子
  • games101-(5/6)
  • 人工智能在计算机视觉中的应用与创新发展研究
  • 1-2 飞机大战游戏场景
  • Mac Electron 应用签名(signature)和公证(notarization)
  • Sklearn 中的逻辑回归
  • 【阅读笔记】New Edge Diected Interpolation,NEDI算法,待续
  • 编程题-最长的回文子串(中等)