コード例 #1
0
ファイル: test_integrated.py プロジェクト: cap/cheqed
 def setup_class(cls):
     cls.env = environment.make_default()
コード例 #2
0
ファイル: views.py プロジェクト: cap/cheqed
import re

from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.template import Context, loader
from django.shortcuts import get_object_or_404, render_to_response

from cheqed.core import environment, sequent, trace

from models import Plan, Proof, Definition

env = environment.make_default()
for definition in Definition.objects.all():
    env.add_definition(definition.text)

def definition_add(request):
    definition = Definition()
    definition.text = str(request.POST['definition'])

    env.add_definition(definition.text)
    definition.save()
    
    return HttpResponseRedirect(reverse(index))

def proof_start(request):
    goal_text = request.POST['goal']
    goal_term = env.parse(str(goal_text).strip())
    goal_seq = sequent.Sequent([], [goal_term])

    p = Plan()
    assumption = env.rules['assumption']()