问题标签 [dafny]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
dafny - 如何在 Dafny 中表示一对(两个元组)?
我怎样才能写一个function
接受一个整数序列并返回一个对序列的 dafny?例如,输入 = [1,2],输出 = [Pair(1,1), Pair(1,2)]
我从
这似乎不起作用。
formal-verification - 如何提示 Dafny 对序列进行归纳?
我想知道我需要在以下内容中添加什么以使其通过 dafny?
dafny - Dafny syntax error in function
I am struggling with dafny syntax.
searchAndReplace
receives three arrays of chars. Let's imagine line
is [s][n][a][k][e]
; pat
is [n][a]
and dst is [h][i]
. I want to search for all the occurrences of pat
in line
and replace it with dst
resulting in [s][h][i][k][e]
Method find
will return the indice of the first letter in line
that is equal to pat
.
Method delete
will remove pat
from line
at the variable at
returned at find
, and move all the others elements after at+p
to the left in order to fill the null spaces.
Method insert
will make space in order to dst
be added to line
at at
by moving all the characters between at
and at + p
p
positions to the right.
I created an auxiliar function which will compare pat
and dst
in order to verify that they aren't equal(if they were it would be replacing infinitely time dst
in line
in case pat
existed in line
)
For now i'm receiving the error "then expected
" on the following section of code inside function checkIfEqual
:
The full code:
formal-verification - 在 Dafny 中寻找搜索和替换的终止措施?
我正在编写一个使用查找、删除和插入方法的搜索和替换方法。我在 while 循环中调用这三个方法,但我不确定应该使用哪些前置条件。
完整代码:
dafny - 面对测试数据时,Dafny 量词没有有用地实例化
我正在尝试在 dafny 中创建一个谓词,以确定字符数组是否包含任何重复项。它最终应该测试以下内容:对于数组中的任何两个元素,如果 theor 值相等,则它们的索引也必须相等。请忽略少于2个元素的情况
但是,当我运行以下测试时,断言失败。为什么会这样?
string - 在 dafny 中更新不可变字符串的最佳方法
我正在尝试验证一个将凯撒密码应用于字符串的程序。必须返回原始字符串
更新字符串值的最佳方法是什么,类似于:
dafny - 对 dafny 中的数字列表求和
我正在使用 dafny 来证明对数字列表求和的不变量:
dafny 无法验证这一点。我错过了作为后置条件sum
吗?
dafny - Dafny 谓词非真非假
Dafny 谓词怎么可能既不真也不假?
这个:
产生双重断言违规:
dafny - 给定几个公理和一个属性,我如何构建该属性的证明?
给定以下公理:
N1==A
我们想用 Dafny来证明这一点。
我尝试过遵循 Dafny 程序:
但达夫尼未能证明这一点。有没有办法N1==A
从给定的公理?