KLEE--搜索方法Search Heuristics



KLEE提供了4中搜索方法:
    01 Depth-First Search (DFS) 深度优先搜索: Traverses states in depth-first order.
    02 Random State Search 随机状态搜索:Randomly selects a state to explore.
    03 Random Path Selection 随机路径搜索: Described in our KLEE OSDI’08 paper.
    04 Non Uniform Random Search (NURS) : Selects a state randomly according to a given distribution. The distribution can be based on the minimum distance to an uncovered instruction (MD2U), the query cost, etc.

可以通过参数--search来设置搜索方法,应用例如下:

    $ klee --search=dfs demo.o

    $ klee --search=random-path demo.o


KLEE帮助,命令如下:

    $ klee --help
    --search   用于指定搜索策略,缺省为随机路径搜索
      =dfs - use Depth First Search (DFS)
      =random-state - randomly select a state to explore
      =random-path - use Random Path Selection (see OSDI'08 paper)
      =nurs:covnew - use Non Uniform Random Search (NURS) with Coverage-New heuristic
      =nurs:md2u - use NURS with Min-Dist-to-Uncovered heuristic
      =nurs:depth - use NURS with 2^depth heuristic
      =nurs:icnt - use NURS with Instr-Count heuristic
      =nurs:cpicnt - use NURS with CallPath-Instr-Count heuristic
      =nurs:qc - use NURS with Query-Cost heuristic

多种方法设置的交替搜索策略,可以如下设置:

    $ klee --search=random-state --search=nurs:md2u demo.o


查询日志--Query Logging

    为了能够记录KLEE符号执行的查询,可以设置如下参数:
    01 --use-query-log=TYPE:FORMAT  其中TYPE is either all to log all the queries KLEE made during execution before any optimisation (e.g. caching, constraint independence) is performed, or solver to log only the queries passed to KLEE’s underlying solver. Note that it is possible that some of the unoptimized queries are never executed or are modified before being executed by KLEE’s underlying solver.
格式FORMAT可以是 pc for the KQuery format, or smt2 for the SMT-LIBv2 format.

    02  --min-query-time-to-log=TIME (in ms) 用于设置哪些查询需要被记录到日志中。缺省为0,表示记录所有查询日志
设置为:<0  表示超时查询才需要被记录。其中超时设置应用参数 --max-solver-time=TIME
设置为:>0  表示超过 TIME milliseconds 的才需要记录

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值