Skip to content
Snippets Groups Projects
Commit bfbf047e authored by Chris's avatar Chris
Browse files

Update python template for quantified constructs

parent 821b5130
No related branches found
No related tags found
No related merge requests found
...@@ -158,7 +158,7 @@ for <identifier> in <set>: ...@@ -158,7 +158,7 @@ for <identifier> in <set>:
iteration_construct_assignment(otherIterationConstructs, type, identifier, set, body) ::= << iteration_construct_assignment(otherIterationConstructs, type, identifier, set, body) ::= <<
<otherIterationConstructs> <otherIterationConstructs>
for <identifier> in <set>: for <identifier> in [<set>]:
<body> <body>
>> >>
...@@ -175,7 +175,7 @@ for <identifier> in <set>.pow().difference(<set>): ...@@ -175,7 +175,7 @@ for <identifier> in <set>.pow().difference(<set>):
>> >>
let_expression_predicate(type, identifier, body) ::= << let_expression_predicate(type, identifier, body) ::= <<
self.<identifier> = None <identifier> = None
<body> <body>
>> >>
...@@ -185,7 +185,7 @@ let_expression_predicate_body(otherIterationConstructs, identifier, val) ::= << ...@@ -185,7 +185,7 @@ let_expression_predicate_body(otherIterationConstructs, identifier, val) ::= <<
>> >>
set_comprehension(type, identifier, isRelation, leftType, rightType, subType, comprehension) ::= << set_comprehension(type, identifier, isRelation, leftType, rightType, subType, comprehension) ::= <<
self.<identifier> = <if(isRelation)>BRelation<else>BSet<endif>() <identifier> = <if(isRelation)>BRelation<else>BSet<endif>()
<comprehension> <comprehension>
>> >>
...@@ -200,7 +200,7 @@ if(<predicate>).booleanValue(): ...@@ -200,7 +200,7 @@ if(<predicate>).booleanValue():
>> >>
lambda(type, identifier, lambda, leftType, rightType) ::= << lambda(type, identifier, lambda, leftType, rightType) ::= <<
self.<identifier> = BRelation() <identifier> = BRelation()
<lambda> <lambda>
>> >>
...@@ -224,7 +224,7 @@ lambda_function_call(arg1, arg2, fromOtherMachine, otherMachine) ::= << ...@@ -224,7 +224,7 @@ lambda_function_call(arg1, arg2, fromOtherMachine, otherMachine) ::= <<
>> >>
quantified_predicate(identifier, forall, predicate) ::= << quantified_predicate(identifier, forall, predicate) ::= <<
self.<identifier> = BBoolean(<if(forall)>true<else>false<endif>) <identifier> = BBoolean(<if(forall)>True<else>False<endif>)
<predicate> <predicate>
>> >>
...@@ -235,23 +235,23 @@ self.<identifier> = BBoolean(<if(forall)>False<else>True<endif>) ...@@ -235,23 +235,23 @@ self.<identifier> = BBoolean(<if(forall)>False<else>True<endif>)
break break
<else> <else>
if <if(forall)>not <endif>(<predicate>).booleanValue(): if <if(forall)>not <endif>(<predicate>).booleanValue():
self.<identifier> = BBoolean(<if(forall)>False<else>True<endif>) <identifier> = BBoolean(<if(forall)>False<else>True<endif>)
break break
<endif> <endif>
>> >>
quantified_expression(identifier, identity, setType, evaluation, isInteger) ::= << quantified_expression(identifier, identity, setType, evaluation, isInteger) ::= <<
<if(isInteger)>self.<identifier> = BInteger(<identity>)<else>self.<identifier> = BSet()<endif> <identifier> = <if(isInteger)>BInteger(<identity>)<else>BSet()<endif>
<evaluation> <evaluation>
>> >>
quantified_expression_evaluation(otherIterationConstructs, emptyPredicate, predicate, identifier, operation, expression) ::= << quantified_expression_evaluation(otherIterationConstructs, emptyPredicate, predicate, identifier, operation, expression) ::= <<
<otherIterationConstructs> <otherIterationConstructs>
<if(emptyPredicate)> <if(emptyPredicate)>
self.<identifier> = self.<identifier>.<operation>(<expression>) <identifier> = <identifier>.<operation>(<expression>)
<else> <else>
if(<predicate>).booleanValue(): if(<predicate>).booleanValue():
self.<identifier> = self.<identifier>.<operation>(<expression>) <identifier> = <identifier>.<operation>(<expression>)
<endif> <endif>
>> >>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment