Skip to content

Instantly share code, notes, and snippets.

@cflewis
cflewis / JPF_java_util_zip_ZipFile.java
Created November 30, 2010 23:20
An attempt at writing a JPF model for ZipFile in Java
package com.cflewis.jpfools.peers;
import gov.nasa.jpf.jvm.MJIEnv;
import java.io.IOException;
import java.util.zip.ZipFile;
public class JPF_java_util_zip_ZipFile {
static ZipFile getZipFile(MJIEnv env, int zipObjectReference) throws IOException {
// You get this from the source itself, it's a private constructor
// that JPF can read
error: Error running '/usr/share/tomcat6/.rvm/bin/ configure --prefix=/usr/share/tomcat6/.rvm/rubies/rbx-1.0.1-20100603 --skip-system', please check /usr/share/tomcat6/.rvm/log/rbx-1.0.1-20100603/configure*.log
error: There has been an error while running '/usr/share/tomcat6/.rvm/bin/ configure --prefix=/usr/share/tomcat6/.rvm/rubies/rbx-1.0.1-20100603 --skip-system'. Aborting the installation.
tomcat6@eisbox:~$ cat /usr/share/tomcat6/.rvm/log/rbx-1.0.1-20100603/configure*.log
[2010-08-31 16:13:01] /usr/share/tomcat6/.rvm/bin/ configure --prefix=/usr/share/tomcat6/.rvm/rubies/rbx-1.0.1-20100603 --skip-system
/usr/share/tomcat6/.rvm/scripts/utility: line 182: /usr/share/tomcat6/.rvm/bin/: is a directory
[2010-08-31 16:14:32] /usr/share/tomcat6/.rvm/bin/ configure --prefix=/usr/share/tomcat6/.rvm/rubies/rbx-1.0.1-20100603 --skip-system
/usr/share/tomcat6/.rvm/scripts/utility: line 182: /usr/share/tomcat6/.rvm/bin/: is a directory
[2010-08-31 16:14:32] /usr/share/tomcat6/.rvm/bin/ configure --prefix=/usr/s
set nocompatible
runtime! autoload/pathogen.vim
if exists('g:loaded_pathogen')
call pathogen#runtime_prepend_subdirectories(expand('~/.vim/bundles'))
end
syntax on
filetype plugin indent on
#!/usr/bin/env ruby
class PrismMachinationsParser
attr_reader :header_line, :state_lines
def initialize(file_name, token_regex)
@prism_file = File.open(file_name, "r")
@header_line = @prism_file.gets.split(" ")
@array_length = header_line.length
@states = self.parse
#!/usr/bin/env ruby
class PrismMachinationsParser
attr_reader :header_line, :state_lines
def initialize(file_name, token_regex)
@prism_file = File.open(file_name, "r")
@header_line = @prism_file.gets.split(" ")
@array_length = header_line.length
@states = self.parse
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
*.alg
*.bbl
begin
$stdin.each_line do |prism_line|
# cflewis | 2010-03-27 | Regular expressions to use
# cflewis | 2010-03-27 | eg. x[3] : [0..2] init blank
array_declaration = /(\s*)(\w+)\[(\d+)\]\s+:\s+(\[.*\]\s+init\s+(\w+)\;)/
# cflewis | 2010-03-27 | eg. x[1]
array_usage = /(\w+)\[(\d+)\]/
separator = "__"
ctmc
formula blank = 0;
formula player_x = 1;
formula player_o = 2;
formula change_current_player = current_player = player_x ? player_o : player_x;
module tictactoe
x1 : [0..2] init blank;
ctmc
formula blank = 0;
formula player_x = 1;
formula player_o = 2;
global next : [player_x..player_o] init player_x;
formula change_next = next = player_x ? player_o : player_x;
module tictactoe
% A script to show using lparse with optimize statements. Pipe into clasp for nicer output.
#hide cost(_,_).
#hide star(_,_).
#hide main_street(_).
% For some reason, lparse chokes on hotel(1..5). Enumerating them all works.
1 { hotel(1), hotel(2), hotel(3), hotel(4), hotel(5) } 1.
star(1,5). star(2,4). star(3,3). star(4,3). star(5,2).